diff --git a/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs b/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs index 0ae4a1b..d569dd1 100644 --- a/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs +++ b/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs @@ -44,7 +44,7 @@ public async Task LoadDataAsync_CheckBucketGroupAssignedBuckets(List buc Name = bucketName, ColorCode = "Red", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { BucketType = 1, Version = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; ServiceManager.BucketService.Create(newBucket); } @@ -90,7 +90,7 @@ public async Task LoadDataAsync_CheckBucketSorting(List bucketNamesUnsor Name = bucketName, ColorCode = "Red", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { BucketType = 1, Version = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; ServiceManager.BucketService.Create(newBucket); } @@ -160,14 +160,11 @@ bool expectedBucketAvailable ValidFrom = bucketActiveSince, IsInactive = bucketIsInactive, IsInactiveFrom = bucketIsInActiveFrom, - BucketVersions = new List + CurrentVersion = new BucketVersion() { - new() - { - Version = 1, - BucketType = 1, - ValidFrom = bucketActiveSince - } + Version = 1, + BucketType = 1, + ValidFrom = bucketActiveSince } }; @@ -203,21 +200,21 @@ public async Task LoadDataAsync_CheckValidFromHandling() BucketGroupId = testBucketGroup.Id, Name = "Bucket Active Current Month", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; var testBucket2 = new Bucket { BucketGroupId = testBucketGroup.Id, Name = "Bucket Active Past", ValidFrom = new DateTime(2009, 1, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; var testBucket3 = new Bucket { BucketGroupId = testBucketGroup.Id, Name = "Bucket Active Future", ValidFrom = new DateTime(2010, 2, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; ServiceManager.BucketService.Create(testBucket1); @@ -262,14 +259,14 @@ public async Task LoadDataAsync_CheckCalculatedValues() BucketGroupId = testBucketGroup.Id, Name = "Bucket 1", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; var testBucket2 = new Bucket { BucketGroupId = testBucketGroup.Id, Name = "Bucket 2", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; ServiceManager.BucketService.Create(testBucket1); @@ -352,10 +349,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with pending Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List(), new List(), @@ -366,10 +360,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with fulfilled Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List(), new List @@ -383,10 +374,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket pending Want including expense", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List { @@ -400,10 +388,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket fulfilled Want including expense", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List { @@ -420,10 +405,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with partial fulfilled Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List(), new List @@ -437,10 +419,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with over fulfilled Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List(), new List @@ -491,10 +470,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, with Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } }, new List(), new List(), @@ -505,10 +481,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, without Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } }, new List(), new List @@ -522,10 +495,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, with Want", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -544,10 +514,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, without Want", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -567,10 +534,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, fulfilled target", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -589,10 +553,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, over-fulfilled target", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -611,10 +572,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, no input", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List(), @@ -625,10 +583,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, input not in sync", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -644,10 +599,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "100 every 3 months, with Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,3,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,3,1) } }, new List(), new List(), @@ -658,10 +610,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "100 every 3 months, last month, with Want", ValidFrom = new DateTime(2009,11,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) } }, new List(), new List @@ -676,10 +625,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "100 every 3 months, last month, input not in sync", ValidFrom = new DateTime(2009,11,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) } }, new List(), new List @@ -694,10 +640,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, with expenses", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List { @@ -720,10 +663,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, 2nd year, last 6 months, with Want", ValidFrom = new DateTime(2008,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,6,1) } }, new List { @@ -767,10 +707,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-12, no input", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } }, new List(), new List(), @@ -781,10 +718,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-12, input in current Month", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } }, new List(), new List @@ -798,10 +732,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, input in sync", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -820,10 +751,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, fulfilled target", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -842,10 +770,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, over-fulfilled target", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -864,10 +789,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, input not in sync", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -883,10 +805,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2009-12, target not reached", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,12,1) } }, new List(), new List @@ -902,10 +821,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "30 until 2010-01, target reached, with expense in target month", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) } }, new List { @@ -924,10 +840,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "30 until 2010-01, target reached, with lower expense in target month", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) } }, new List { @@ -946,10 +859,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "30 until 2010-01, target reached, with higher expense in target month", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) } }, new List {