Ejemplo n.º 1
0
        public void TestCustomerListLength()
        {
            //Arrange
            Customer c = new Customer();

            OresundCar      oCar1 = new OresundCar();
            WeekendDiscount sCar1 = new WeekendDiscount();
            Car             car1  = new Car();
            MC        mc1         = new MC();
            OresundMC oMC         = new OresundMC();


            //Act
            oCar1.Price(false);
            sCar1.WeekendDiscountCar(false);
            car1.Price(true);
            mc1.Price(false);
            oMC.Price(true);
            c.TripsList.Add(oCar1);
            c.TripsList.Add(sCar1);
            c.TripsList.Add(car1);
            c.TripsList.Add(mc1);
            c.TripsList.Add(oMC);

            //Assert
            Assert.AreEqual(5, c.TripsList.Count);
        }
Ejemplo n.º 2
0
        public void TestCustomerListPriceSum()
        {
            //Arrange
            Customer c = new Customer();

            OresundCar      oCar1 = new OresundCar();
            WeekendDiscount sCar1 = new WeekendDiscount();
            Car             car1  = new Car();
            MC        mc1         = new MC();
            OresundMC oMC         = new OresundMC();


            //Act
            oCar1.Price(false);
            sCar1.WeekendDiscountCar(false);
            car1.Price(true);
            mc1.Price(false);
            oMC.Price(true);
            c.TripsList.Add(oCar1);
            c.TripsList.Add(sCar1);
            c.TripsList.Add(car1);
            c.TripsList.Add(mc1);
            c.TripsList.Add(oMC);

            double totalPrice = c.TotalPriceOfAllTrips();

            //Assert
            Assert.AreEqual(1028, totalPrice);
        }
        public void TestVehicleTypeMC()
        {
            //Arrange
            OresundMC mc = new OresundMC();

            //Act
            string vT = mc.VehicleType();

            //Assert
            Assert.AreEqual("Oresund MC", vT);
        }
        public void TestOresundMCPrice(bool useBrobizz, double expected)
        {
            //Arrange
            OresundMC mc = new OresundMC();

            //Act
            double price = mc.Price(useBrobizz);

            //Assert
            Assert.AreEqual(expected, price);
        }
Ejemplo n.º 5
0
        public static void CreateVehicleObject()
        {
            switch (SelectedTicketType)
            {
            case Constants.TicketType.GENERIC_TICKET:
                if (SelectedVehicleType == Constants.VehicleType.CAR)
                {
                    VehicleObject = new Car();
                }
                else if (SelectedVehicleType == Constants.VehicleType.MOTORCYCLE)
                {
                    VehicleObject = new MC();
                }
                break;

            case Constants.TicketType.STOREBAELT_TICKET:
                if (SelectedVehicleType == Constants.VehicleType.CAR)
                {
                    VehicleObject = new Car();
                }
                if (SelectedVehicleType == Constants.VehicleType.MOTORCYCLE)
                {
                    VehicleObject = new MC();
                }
                break;

            case Constants.TicketType.ORESUND_TICKET:
                if (SelectedVehicleType == Constants.VehicleType.CAR)
                {
                    VehicleObject = new OresundCar();
                }
                else if (SelectedVehicleType == Constants.VehicleType.MOTORCYCLE)
                {
                    VehicleObject = new OresundMC();
                }
                break;
            }
        }