public ValidationData AssertDates(BeazleyUIDataModel data, ValidationData vd) { vd.PolicyReference = jsonHelper.GetPolicyReference(data); vd.TestName = jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.TestName); AssertInceptionDate(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.INCEPTION_DATE)); AssertExpiryDate(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.EXPIRY_DATE)); return(vd); }
public ValidationData AssertRateChangeValues(BeazleyUIDataModel data) { AssertRateChangeValue(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.RateChange)); AssertPremiumChangeDueToExcess(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.ExcessChange)); AssertPremiumChangeDueToSI(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.SumInsuredChange)); AssertOtherChanges(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.OtherChanges)); AssertRiskAdjustedRateChange(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.RiskAdjChange)); return(_vd); }
public ValidationData AssertInterestPageValues(BeazleyUIDataModel data) { AssertUnderwritingPlatform(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.UNDERWRITING_PLATFORM)); AssertServiceCompanyCode(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.SERIVCE_COMPANY_CODE)); AssertCobCode(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.COB_CODE)); AssertTriFocus(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.TRI_FOCUS)); AssertStatCode(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.STAT_CODE)); AssertRiskCode(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.RISK_CODE)); AssertBinderReference(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.BINDER_REFERENCE)); AssertUMR(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.UMR)); return(_vd); }
public ValidationData AssertPremiumValues(BeazleyUIDataModel data) { AssertNetPremium(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.NetPremium)); AssertTaxAndFees(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.Tax)); AssertCommission(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.Commission)); AssertGrossPremium(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.GrossPremium)); if (jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.TestName).Contains("_DD")) { AssertNetAmountPayable(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.TotalPremium)); } else { AssertNetAmountPayable(_vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.NetPremiumPayable)); } return(_vd); }
public ValidationData AssertPremiumValues(BeazleyUIDataModel data, ValidationData vd) { vd.PolicyReference = jsonHelper.GetPolicyReference(data); vd.TestName = jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.TestName); AssertGrossPremium(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.GrossPremium)); AssertTaxAndFees(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.Tax)); AssertNetPremium(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.NetPremium)); AssertNetAmountPayable(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.NetPremiumPayable)); AssertTotalPremium(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.TotalPremium)); if (jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.TestType).Equals(HelperConstants.Correction)) { AssertBusinessName(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.InsuredName)); AssertAddressLine(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.AddressLine)); AssertPostCode(vd, jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.PostCode)); } return(vd); }
private ValidationData MainTestMethod(BeazleyUIDataModel data) { SetUpChromeInstance(); ValidationData validationData = new ValidationData(); JsonHelper jsonHelper = new JsonHelper(); Billing billing = null; try { var loginPage = new LoginPage(); var homePage = loginPage.Login(data.Product); var policySelection = homePage.SearchPolicy(jsonHelper.GetPolicyReference(data), jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.InsuredName)); var policySummary = policySelection.SelectPolicy(jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.RowNumberToCheck)); if (jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.IsBrexit).Equals("True")) { validationData = policySummary.AssertDates(data, validationData); var interestPage = policySummary.GoToInterestPage(validationData); validationData = interestPage.AssertInterestPageValues(data); } else { validationData = policySummary.AssertPremiumValues(data, validationData); billing = policySummary.GoToBillingPage(validationData); validationData = billing.AssertPremiumValues(data); } if (data.Product.Contains("Marine") && jsonHelper .GetValueDataFromBeazleyDictionary(data, HelperConstants.TestType).Equals("Renewal")) { var rateChange = billing.GoToRateRateChange(validationData); validationData = rateChange.AssertRateChangeValues(data); } } catch (Exception ex) { validationData.PolicyReference += $" / Test: {jsonHelper.GetValueDataFromBeazleyDictionary(data, HelperConstants.TestName)} failed."; } return(validationData); }