Beispiel #1
0
        public void PassignNullThirdPartyGrvObject()
        {
            _thirdPartyGrv = null;
            var ex = Assert.Throws <NullReferenceException>(() => _baseCalculatorService.CalculateThirdPartyGrvStl13(_thirdPartyGrv));

            Assert.That(ex.Message, Is.EqualTo($"thirdPartyGrv is null"));
        }
Beispiel #2
0
 public void Setup()
 {
     _baseCalculatorService = new BaseCalculatorService();
     _thirdPartyGrv         = new ThirdPartyGrv();
     _thirdPartyGrvResult   = new ThirdPartyGrvResult();
     _thirdPartyGrvExpected = new ThirdPartyGrvResult();
 }
Beispiel #3
0
 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);
        }
Beispiel #5
0
 public void IHaveEnteredNullObjectIntoTheCalculateThirdPartyGrvStl13APIEndPoint()
 {
     _thirdPartyGrv = new ThirdPartyGrv();
 }
Beispiel #6
0
 public void GivenIHaveEnteredTheFollowingValuesToTheAPIEndPoint(Table thirdPartyGrvObject)
 {
     _thirdPartyGrv = thirdPartyGrvObject.CreateInstance <ThirdPartyGrv>();
 }