public void PassignNullThirdPartyGrvObject() { _thirdPartyGrv = null; var ex = Assert.Throws <NullReferenceException>(() => _baseCalculatorService.CalculateThirdPartyGrvStl13(_thirdPartyGrv)); Assert.That(ex.Message, Is.EqualTo($"thirdPartyGrv is null")); }
public void Setup() { _baseCalculatorService = new BaseCalculatorService(); _thirdPartyGrv = new ThirdPartyGrv(); _thirdPartyGrvResult = new ThirdPartyGrvResult(); _thirdPartyGrvExpected = new ThirdPartyGrvResult(); }
public CalculateThirdPartyGrvStl13Steps() { _baseUrl = "https://amtcalculator.azurewebsites.net/"; _endPointService = "api/GasbCalculator/CalculateThirdPartyGrvStl13"; _thirdPartyGrvResult = new ThirdPartyGrvResult(); _thirdPartyGrv = new ThirdPartyGrv(); _amtErrorMessage = new AMTErrorMessage(); }
public IThirdPartyGrvResult CalculateThirdPartyGrvStl13(IThirdPartyGrv thirdPartyGrv) { if (thirdPartyGrv == null) { throw new NullReferenceException($"thirdPartyGrv is null"); } IThirdPartyGrvResult thirdPartyGrvResult = new ThirdPartyGrvResult(); decimal period = 1300; int precision = 2; var test = (thirdPartyGrv.RateImplicit / period) * thirdPartyGrv.PVofGuaranteedRV; var test2 = test + thirdPartyGrv.CuUnearnedIntThirdPartyGrvStl; thirdPartyGrvResult.ThirdPartyGrvStl = MathHelper.SetPrecision(thirdPartyGrv.PVofGuaranteedRV, precision); thirdPartyGrvResult.NetThirdPartyGrvStl = MathHelper.SetPrecision((thirdPartyGrv.PVofGuaranteedRV + test), precision); thirdPartyGrvResult.UnearnedIntThirdPartyGrvStl = MathHelper.SetPrecision(test2, precision); thirdPartyGrvResult.NetInvestmentInLeaseStl = MathHelper.SetPrecision(thirdPartyGrv.NetInvLeaseSTL, precision); return(thirdPartyGrvResult); }
public void IHaveEnteredNullObjectIntoTheCalculateThirdPartyGrvStl13APIEndPoint() { _thirdPartyGrv = new ThirdPartyGrv(); }
public void GivenIHaveEnteredTheFollowingValuesToTheAPIEndPoint(Table thirdPartyGrvObject) { _thirdPartyGrv = thirdPartyGrvObject.CreateInstance <ThirdPartyGrv>(); }