public async Task Cleanup_DuplicateSubmissionIdsInInput_DuplicatedSubmissionIdsShouldBeLogged() { //Arrange var fixtures = new LevyImportCleanerStrategyTestFixtures() .WithDeclarations(123, 123); // act await fixtures.RunStrategy(); //Assert const int expectedInfoMessages = 1; Assert.AreEqual(expectedInfoMessages, fixtures.InfoLog.Count); }
public async Task Cleanup_DuplicateSubmissionIdsInInput_DuplicatedSubmissionIdsShouldBeRemoved() { //Arrange var fixtures = new LevyImportCleanerStrategyTestFixtures() .WithDeclarations(123, 123); // act await fixtures.RunStrategy(); //Assert const int expectedCount = 1; Assert.AreEqual(expectedCount, fixtures.Result.Length); }
public async Task Cleanup_MultipleLevyAdjustments_OnlyAdjustmentsShouldBeMArkedAsAdjustments() { //Arrange var fixtures = new LevyImportCleanerStrategyTestFixtures() .WithDeclaration(123, 100, "17-18", 12, new DateTime(2018, 04, 19)) .WithDeclaration(124, 150, "17-18", 12, new DateTime(2018, 05, 19)) .WithDeclaration(125, 200, "17-18", 12, new DateTime(2018, 06, 19)); // act await fixtures.RunStrategy(); //Assert Assert.IsFalse(fixtures.Result[0].EndOfYearAdjustment, "normal period 12 declaration is marked as adjustment"); Assert.IsTrue(fixtures.Result[1].EndOfYearAdjustment, "period 12 adjustment is not marked as adjustment"); Assert.IsTrue(fixtures.Result[2].EndOfYearAdjustment, "period 12 adjustment is not marked as adjustment"); }
public async Task Cleanup_AdjustmentWithNoDeclaration_AdjustmentShouldApplyToAnAssummedZeroDeclaration() { const decimal adjustmentValue = 200; //Arrange var fixtures = new LevyImportCleanerStrategyTestFixtures() .WithDeclaration(124, adjustmentValue, "17-18", 12, new DateTime(2018, 05, 19)); // act await fixtures.RunStrategy(); //Assert const decimal expectedYearEndAdjustment = adjustmentValue * -1; // adjustments are inverted Assert.AreEqual(expectedYearEndAdjustment, fixtures.Result[0].EndOfYearAdjustmentAmount); }
public async Task Cleanup_SingleLevyAdjustmentAppliedToAnOntimePeriod12Submission_AdjustmentShouldUseTheP12Adjustment() { const decimal period12Value = 10000; const decimal firstAdjustmentValue = 20000; //Arrange var fixtures = new LevyImportCleanerStrategyTestFixtures() .WithDeclaration(123, period12Value, "17-18", 12, new DateTime(2018, 03, 15)) .WithDeclaration(124, firstAdjustmentValue, "17-18", 12, new DateTime(2018, 09, 15)); // act await fixtures.RunStrategy(); //Assert const decimal expectedYearEndAdjustment = (firstAdjustmentValue - period12Value) * -1; // adjustments are inverted }
public async Task Cleanup_SingleLevyAdjustmentWithPeriod8Value_AdjustmentShouldApplyToPeriod8Value() { const decimal period8Value = 150; const decimal adjustmentValue = 200; //Arrange var fixtures = new LevyImportCleanerStrategyTestFixtures() .WithDeclaration(123, period8Value, "17-18", 8, new DateTime(2017, 12, 19)) .WithDeclaration(124, adjustmentValue, "17-18", 12, new DateTime(2018, 05, 19)); // act await fixtures.RunStrategy(); //Assert const decimal expectedYearEndAdjustment = (adjustmentValue - period8Value) * -1; // adjustments are inverted Assert.AreEqual(expectedYearEndAdjustment, fixtures.Result[1].EndOfYearAdjustmentAmount); }
public async Task Cleanup_MultipleLevyAdjustments_LaterAdjustmentsShouldApplyToPriorAdjustments() { const decimal firstAdjustmentValue = 150; const decimal secondAdjustmentValue = 200; //Arrange var fixtures = new LevyImportCleanerStrategyTestFixtures() .WithDeclaration(123, 100, "17-18", 12, new DateTime(2018, 04, 19)) .WithDeclaration(124, firstAdjustmentValue, "17-18", 12, new DateTime(2018, 05, 19)) .WithDeclaration(125, secondAdjustmentValue, "17-18", 12, new DateTime(2018, 06, 19)); // act await fixtures.RunStrategy(); //Assert const decimal expectedYearEndAdjustment = (secondAdjustmentValue - firstAdjustmentValue) * -1; // adjustments are inverted Assert.AreEqual(expectedYearEndAdjustment, fixtures.Result[2].EndOfYearAdjustmentAmount); }