Beispiel #1
0
        public void When_IsApplicable_Called_For_NewCars_Then_Result_ShouldBe_Expected()
        {
            // arrange
            var zeroYearsStatery = new OlderThanAYearStrategy();
            var vehicaleAge      = 0;
            var expected         = false;

            // act
            var result = zeroYearsStatery.IsApplicable(vehicaleAge);

            // assert
            Assert.AreEqual(expected, result);
        }
Beispiel #2
0
        public void When_CalculatePriceReductionByAge_Called_For_4YearOldCar_Then_Result_ShouldBe_Expected()
        {
            // arrange
            var expected             = 2782.41m;
            var olderThanYearStatery = new OlderThanAYearStrategy();

            Vehicle vehicle = new Vehicle()
            {
                AgeInYears    = 4,
                BaseValuation = 15000,
            };

            // act
            var result = olderThanYearStatery.CalculatePriceReductionByAge(vehicle);

            // assert
            Assert.AreEqual(expected, result);
        }