Exemplo n.º 1
0
        public void CalculateToll_TankTests()
        {
            Tank tank = new Tank();

            Assert.AreEqual("Tank", tank.Type);
            Assert.AreEqual(0.0, tank.CalculateToll(0), 0.001);
            Assert.AreEqual(0.0, tank.CalculateToll(100), 0.001);
            Assert.AreEqual(0.0, tank.CalculateToll(1000), 0.001);
        }
Exemplo n.º 2
0
        public void TankTest()
        {
            Tank tankVehichle = new Tank();

            Assert.AreEqual(0, tankVehichle.CalculateToll(-23));
            Assert.AreEqual(0, tankVehichle.Distance);
            Assert.AreEqual(0, tankVehichle.Toll);
            Assert.AreEqual(0, tankVehichle.CalculateToll(500));
            Assert.AreEqual(500, tankVehichle.Distance);
            Assert.AreEqual(0, tankVehichle.Toll);
            Assert.AreEqual("Tank", tankVehichle.TypeOfVehichle);
        }
        public void VehicleTests()
        {
            Car testCar        = new Car(false);
            Car testCarTrailer = new Car(true);

            Truck testTruck4 = new Truck(4);
            Truck testTruck6 = new Truck(6);
            Truck testTruck8 = new Truck(8);

            Tank testTank = new Tank();

            Assert.AreEqual(2.00, testCar.CalculateToll(100));
            Assert.AreEqual(3.00, testCarTrailer.CalculateToll(100));

            Assert.AreEqual(6.00, testTruck4.CalculateToll(150));
            Assert.AreEqual(6.75, testTruck6.CalculateToll(150));
            Assert.AreEqual(7.20, testTruck8.CalculateToll(150));

            Assert.AreEqual(0, testTank.CalculateToll(100));
            Assert.AreEqual(0, testTank.CalculateToll(150));
            Assert.AreEqual(0, testTank.CalculateToll(200));
        }
Exemplo n.º 4
0
        public void CalculateToll()
        {
            Tank  tom    = new Tank("Tank");
            Car   car1   = new Car(true, "Car");
            Car   car2   = new Car(false, "Car");
            Truck truck1 = new Truck(6, "Truck");
            Truck truck2 = new Truck(4, "Truck");
            Truck truck3 = new Truck(8, "Truck");

            Assert.AreEqual(0, tom.CalculateToll(300));
            Assert.AreEqual(5.68, car1.CalculateToll(234));
            Assert.AreEqual(2.94, car2.CalculateToll(147));
            Assert.AreEqual(5.895, truck1.CalculateToll(131));
            Assert.AreEqual(6.88, truck2.CalculateToll(172));
            Assert.AreEqual(6.048, truck3.CalculateToll(126));
        }
Exemplo n.º 5
0
        public void TankCalculateTollTest()
        {
            Tank testTank = new Tank();

            Assert.AreEqual(0, testTank.CalculateToll(99));
        }
Exemplo n.º 6
0
        public void TankTest()
        {
            Tank tankTest = new Tank();

            Assert.AreEqual(0, tankTest.CalculateToll(100));
        }