Ejemplo n.º 1
0
        public void RentalFamilyTest()
        {
            //Creates the collection of rentals
            List <IRental> listRentals = new List <IRental>();

            listRentals.Add(new RentalHour()
            {
                cantRent = 9
            });
            listRentals.Add(new RentalDay()
            {
                cantRent = 3
            });
            listRentals.Add(new RentalWeek()
            {
                cantRent = 12
            });

            FamilyRental rf = new FamilyRental(listRentals);

            //The function calculation for the total of the cost
            double totalCost = rf.CalcCost();

            Assert.AreEqual(totalCost, 577.5);
        }
Ejemplo n.º 2
0
        public void RentalFamilyTestFailNoPromotion()
        {
            //Creates the collection of rentals
            List <IRental> listRentals = new List <IRental>();

            listRentals.Add(new RentalHour()
            {
                cantRent = 9
            });
            listRentals.Add(new RentalDay()
            {
                cantRent = 3
            });

            FamilyRental rf = new FamilyRental(listRentals);

            try
            {
                //The function calculation for the total of the cost
                double totalCost = rf.CalcCost();
                Assert.Fail("Without promocion");
            }
            catch (Exception ex)
            {
                // whatever logging code
            }
        }
Ejemplo n.º 3
0
        public void RentalFamilyTestFailNoRentals()
        {
            //Creates the collection of rentals
            List <IRental> listRentals = new List <IRental>();

            FamilyRental rf = new FamilyRental(listRentals);

            try
            {
                //The function calculation for the total of the cost
                double totalCost = rf.CalcCost();
                Assert.Fail("Without rents");
            }
            catch (Exception ex)
            {
                // whatever logging code
            }
        }