public void WhenTheSFAEmployerHMRCLevyServiceNotifiesTheForecastingServiceOfTheLevyDeclarations() { LevySubmissions.Select(levySubmission => new LevySchemeDeclarationUpdatedMessage { SubmissionId = levySubmission.SubmissionId, AccountId = Config.EmployerAccountId, LevyDeclaredInMonth = levySubmission.Amount, PayrollMonth = PayrollPeriod.PayrollMonth, PayrollYear = PayrollPeriod.PayrollYear, CreatedDate = levySubmission.CreatedDateValue, EmpRef = levySubmission.Scheme }) .ToList() .ForEach(levyEvent => { var payload = levyEvent.ToJson(); var url = Config.LevyFunctionUrl; Console.WriteLine($"Sending levy event to levy function: {url}, Payload: {payload}"); var response = HttpClient.PostAsync(url, new StringContent(payload, Encoding.UTF8, "application/json")).Result; Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); }); }
public void ThenEachFutureMonthSForecastLevyCreditShouldBeTheSame() { var fundsIn = LevySubmissions.Sum(levy => levy.Amount); Assert.IsTrue(AccountProjections.All(projection => projection.LevyFundsIn == fundsIn)); }
public void ThenCalculatedLevyCreditValueShouldBeTheAmountDeclaredForTheSumOfTheLinkedPAYESchemes() { AccountProjections.ForEach(projection => Assert.AreEqual(projection.LevyFundsIn, LevySubmissions.Sum(levy => levy.Amount), $"Expected the account projections to be {LevySubmissions.FirstOrDefault()?.Amount} but was {projection.LevyFundsIn}")); }
public void GivenIHaveMadeTheFollowingLevyDeclarations(Table table) { LevySubmissions = table.CreateSet <LevySubmission>().ToList(); Assert.IsTrue(LevySubmissions.Any()); }