public void CheckDSGProfile() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(DSGRequest, writer)); Assert.AreEqual(expected: 96.00M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Apr" && q.Occurence == 1 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Apr" && q.Occurence == 2 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Apr" && q.Occurence == 3 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "May" && q.Occurence == 1 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "May" && q.Occurence == 2 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jun" && q.Occurence == 1 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jun" && q.Occurence == 2 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jul" && q.Occurence == 1 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jul" && q.Occurence == 2 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Aug" && q.Occurence == 1 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Aug" && q.Occurence == 2 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Sep" && q.Occurence == 1 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Sep" && q.Occurence == 2 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Oct" && q.Occurence == 1 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Oct" && q.Occurence == 2 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Nov" && q.Occurence == 1 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Nov" && q.Occurence == 2 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Dec" && q.Occurence == 1 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Dec" && q.Occurence == 2 && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jan" && q.Occurence == 1 && q.PeriodYear == 2019).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jan" && q.Occurence == 2 && q.PeriodYear == 2019).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Feb" && q.Occurence == 1 && q.PeriodYear == 2019).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Feb" && q.Occurence == 2 && q.PeriodYear == 2019).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Mar" && q.Occurence == 1 && q.PeriodYear == 2019).ProfileValue); Assert.AreEqual(96.00M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Mar" && q.Occurence == 2 && q.PeriodYear == 2019).ProfileValue); Assert.AreEqual(response.ProfilePeriods.Count, 25); }
public void CheckPESportPremiumProfileWithMonthlyPeriods() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(PESportRequest, writer)); Assert.AreEqual(expected: 14000000.00M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Oct").ProfileValue); Assert.AreEqual(expected: 10000000.00M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Apr").ProfileValue); Assert.AreEqual(response.ProfilePeriods.Count, 2); }
public void CheckPESportPremiumReProfile() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(PESportPremiumRequestReProfile, writer)); Assert.AreEqual(expected: 70.00M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "H1").ProfileValue); Assert.AreEqual(expected: 80.00M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "H2").ProfileValue); Assert.AreEqual(response.ProfilePeriods.Count, 2); }
public void CheckPESportPremiumNewReProfileBeforeFirstPayment() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(PESportPremiumNewReProfileBeforeFirstPaymentRequest, writer)); Assert.AreEqual(expected: 140.00M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "P1").ProfileValue); Assert.AreEqual(expected: 0.00M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "P2").ProfileValue); Assert.AreEqual(expected: 100.00M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "P3").ProfileValue); Assert.AreEqual(response.ProfilePeriods.Count, 3); }
public void CheckPupilPremiumProfile() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(PupilPremiumRequest, writer)); Assert.AreEqual(expected: 600M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Q1").ProfileValue); Assert.AreEqual(expected: 600M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Q2").ProfileValue); Assert.AreEqual(expected: 840M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Q3").ProfileValue); Assert.AreEqual(expected: 360M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Q4").ProfileValue); Assert.AreEqual(response.ProfilePeriods.Count, 4); }
public void CheckNonLevy1618ProfileShortAllocation() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(NonLevy1618RequestShortAllocation, writer)); Assert.AreEqual(response.ProfilePeriods.Count, 6); Assert.AreEqual(35.96M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Aug" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(54.60M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Sep" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(68.68M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Oct" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(59.98M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Nov" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(96.29M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Dec" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(84.49M, response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jan" && q.PeriodYear == 2019).ProfileValue); }
public void CheckAEBProfileForProviderWithPattern() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(AEBRequestForProviderWithPattern, writer)); Assert.AreEqual(response.ProfilePeriods.Count, 12); Assert.AreEqual(expected: 171.11M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Aug").ProfileValue); Assert.AreEqual(expected: 273.90M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Sep").ProfileValue); Assert.AreEqual(expected: 276.78M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Oct").ProfileValue); Assert.AreEqual(expected: 226.02M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Nov").ProfileValue); Assert.AreEqual(expected: 237.51M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Dec").ProfileValue); Assert.AreEqual(expected: 181.64M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jan").ProfileValue); Assert.AreEqual(expected: 172.07M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Feb").ProfileValue); Assert.AreEqual(expected: 460.97M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Mar").ProfileValue); Assert.AreEqual(expected: 135.91M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Apr").ProfileValue); Assert.AreEqual(expected: 109.34M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "May").ProfileValue); Assert.AreEqual(expected: 61.58M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jun").ProfileValue); Assert.AreEqual(expected: 93.17M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jul").ProfileValue); }
public void Check1618AppsProfile() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(Sixteen18AAppsRequest, writer)); Assert.AreEqual(response.ProfilePeriods.Count, 12); Assert.AreEqual(expected: 249.82M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Aug").ProfileValue); Assert.AreEqual(expected: 249.81M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Sep").ProfileValue); Assert.AreEqual(expected: 249.81M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Oct").ProfileValue); Assert.AreEqual(expected: 249.81M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Nov").ProfileValue); Assert.AreEqual(expected: 249.81M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Dec").ProfileValue); Assert.AreEqual(expected: 249.81M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jan").ProfileValue); Assert.AreEqual(expected: 249.81M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Feb").ProfileValue); Assert.AreEqual(expected: 251.32M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Mar").ProfileValue); Assert.AreEqual(expected: 100.15M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Apr").ProfileValue); Assert.AreEqual(expected: 100.15M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "May").ProfileValue); Assert.AreEqual(expected: 100.15M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jun").ProfileValue); Assert.AreEqual(expected: 99.55M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jul").ProfileValue); }
public void CheckNonLevy1618Profile() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(NonLevy1618Request, writer)); Assert.AreEqual(response.ProfilePeriods.Count, 15); Assert.AreEqual(expected: 372.88M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jan" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 677.97M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Feb" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 949.15M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Mar" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 18.90M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Apr" && q.PeriodYear == 2018).ProfileValue); //penny out - £18.90 as per excel Assert.AreEqual(expected: 18.72M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "May" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 19.13M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jun" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 19.50M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jul" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 21.34M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Aug" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 32.40M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Sep" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 40.76M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Oct" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 35.60M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Nov" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 57.15M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Dec" && q.PeriodYear == 2018).ProfileValue); Assert.AreEqual(expected: 50.14M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Jan" && q.PeriodYear == 2019).ProfileValue); Assert.AreEqual(expected: 45.27M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Feb" && q.PeriodYear == 2019).ProfileValue); Assert.AreEqual(expected: 41.09M, actual: response.ProfilePeriods.ToArray().FirstOrDefault(q => q.Period == "Mar" && q.PeriodYear == 2019).ProfileValue); }
public void CheckAEBProfileShortAllocation() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(AEBRequestShortAllocation, writer)); Assert.AreEqual(response.ProfilePeriods.Count, 5); }
public void CheckNonLevyAdultProfile() { Response response = JsonConvert.DeserializeObject <Response>(AllocationProfiler.GetGenericResponse(NonLevyAdultRequest, writer)); Assert.AreEqual(response.ProfilePeriods.Count, 15); }