Esempio n. 1
0
        public void TestCarInput_Eco()
        {
            var testFordon = new Vehicle(VehicleType.Car, DateTime.Now, true, Weight.Under1000Kg);
            var actual     = new CalculateToll().CalculateTotalTollPrice(testFordon);

            Assert.AreEqual(excpectedPriceEco, actual);
        }
Esempio n. 2
0
        public void TestInput_Under1000kg()
        {
            var testFordon = new Vehicle(VehicleType.Motorcycle, new DateTime(2018, 05, 09), false,
                                         Weight.Under1000Kg);

            var actual = new CalculateToll().CalculateTotalTollPrice(testFordon);

            Assert.AreEqual(350, actual);
        }
Esempio n. 3
0
        public void TestTruck_Sunday()
        {
            double expectedTotalPriceTruck_sunday = 4000;
            var    testFordon = new Vehicle(VehicleType.Truck, new DateTime(2018, 05, 12), false, Weight.Over1000Kg);
            var    actual     = new CalculateToll().CalculateTotalTollPrice(testFordon);

            Assert.AreEqual(expectedTotalPriceTruck_sunday, actual);


            var testFordonEco = new Vehicle(VehicleType.Truck, new DateTime(2018, 05, 12), true, Weight.Over1000Kg);
            var actualEco     = new CalculateToll().CalculateTotalTollPrice(testFordonEco);

            Assert.AreEqual(0, actualEco);
        }
Esempio n. 4
0
        public void TestCar_Heavy()
        {
            var testFordonEco = new Vehicle(VehicleType.Car, new DateTime(2018, 05, 11), true, Weight.Over1000Kg);
            var actualEco     = new CalculateToll().CalculateTotalTollPrice(testFordonEco);

            Assert.AreEqual(0, actualEco);

            var testFordonSunday = new Vehicle(VehicleType.Car, new DateTime(2018, 05, 13), false,
                                               Weight.Over1000Kg);

            _expectedTotalPrice = 2000;
            var actual = new CalculateToll().CalculateTotalTollPrice(testFordonSunday);

            Assert.AreEqual(_expectedTotalPrice, actual);
        }