[WIP] Use compiled queries
All checks were successful
Test / Run tests (push) Successful in 3m0s

This commit is contained in:
2026-04-04 15:28:30 +02:00
parent bd1e579674
commit c3cf239cba
35 changed files with 332 additions and 302 deletions

View File

@@ -135,7 +135,7 @@ namespace Tests.UnitTests.HelperTests {
Assert.That(delivery["GVK"], Is.EqualTo( 4_000));
});
BillingVariant b = new(year, 1);
var b = await BillingVariant.Create(year, 1);
await b.CalculateBuckets(false, false, false);
var payment = await GetMemberPaymentBuckets(year, mgnr);
Assert.Multiple(() => {
@@ -179,7 +179,7 @@ namespace Tests.UnitTests.HelperTests {
Assert.That(delivery["GVK"], Is.EqualTo( 4_000));
});
BillingVariant b = new(year, 1);
var b = await BillingVariant.Create(year, 1);
await b.CalculateBuckets(false, false, false, Connection);
var payment = await GetMemberPaymentBuckets(year, mgnr);
Assert.Multiple(() => {
@@ -225,7 +225,7 @@ namespace Tests.UnitTests.HelperTests {
Assert.That(delivery["GVK"], Is.EqualTo( 4_000));
});
BillingVariant b = new(year, 1);
var b = await BillingVariant.Create(year, 1);
await b.CalculateBuckets(true, false, false, Connection);
var payment = await GetMemberPaymentBuckets(year, mgnr);
Assert.Multiple(() => {

View File

@@ -10,19 +10,19 @@ namespace Tests.UnitTests.ServiceTests {
private static async Task InitViewModel(DeliveryAdminViewModel vm) {
using var ctx = new AppDbContext();
vm.MemberSource = await ctx.Members.ToListAsync();
vm.BranchSource = await ctx.Branches.ToListAsync();
vm.WineVarSource = await ctx.WineVarieties.ToListAsync();
List<object> attrs = (await ctx.WineAttributes.ToListAsync()).Cast<object>().ToList();
vm.MemberSource = await ctx.FetchMembers(true).ToListAsync();
vm.BranchSource = await ctx.FetchBranches().ToListAsync();
vm.WineVarSource = await ctx.FetchWineVarieties().ToListAsync();
List<object> attrs = await ctx.FetchWineAttributes().Cast<object>().ToListAsync();
attrs.Insert(0, new NullItem());
vm.WineAttrSource = attrs;
List<object> cults = (await ctx.WineCultivations.ToListAsync()).Cast<object>().ToList();
List<object> cults = await ctx.FetchWineCultivations().Cast<object>().ToListAsync();
cults.Insert(0, new NullItem());
vm.WineCultSource = cults;
vm.WineQualityLevelSource = await ctx.WineQualityLevels.ToListAsync();
vm.WineQualityLevelSource = await ctx.FetchWineQualityLevels().ToListAsync();
vm.WineOriginSource = await ctx.WineOrigins.ToListAsync();
vm.WineKgSource = await ctx.Katastralgemeinden.ToListAsync();
vm.ModifiersSource = await ctx.Modifiers.Where(m => m.Year == 2022).ToListAsync();
vm.ModifiersSource = await ctx.FetchModifiers(2022).ToListAsync();
}
private static async Task<Delivery?> GetDelivery(string lsnr) {

View File

@@ -10,7 +10,7 @@ namespace Tests.UnitTests.ServiceTests {
private static async Task InitViewModel(MemberAdminViewModel vm) {
using var ctx = new AppDbContext();
vm.BranchSource = await ctx.Branches.ToListAsync();
vm.BranchSource = await ctx.FetchBranches().ToListAsync();
vm.DefaultKgSource = await ctx.Katastralgemeinden.ToListAsync();
vm.OrtSource = await ctx.PlzDestinations.ToListAsync();
vm.BillingOrtSource = await ctx.PlzDestinations.ToListAsync();