Пример #1
0
        static void Main(string[] args)
        {
            Customer customer = new Customer("Nick");

            customer.Rentals.Add(new Rental(Scooter.BMW("FX300"), 4));
            customer.Rentals.Add(new Rental(Scooter.Honda("M250"), 4));
            customer.Rentals.Add(new Rental(Scooter.Suzuki("RX5"), 5));
            var result = customer.CalculateDept();

            Console.WriteLine($"Client {customer.Name}. Dept - {result}");

            ReportManager.CreateSimpleReport(@"D:\\ReportTest.txt", customer);
        }
 public void Test_CreateRentalDaysException()
 {
     try
     {
         Rental rental = new Rental(Scooter.Suzuki("M100"), -5);
         Assert.Fail();
     }
     catch (ArgumentDaysException e)
     {
         Assert.AreEqual(e.Days, -5);
     }
     catch (Exception)
     {
         Assert.Fail();
     }
 }
 public void Test_SubstractionDaysException()
 {
     try
     {
         Rental rental = new Rental(Scooter.Suzuki("M100"), 5);
         rental.SubtractionDays(6);
         Assert.Fail();
     }
     catch (ArgumentDaysException e)
     {
         Assert.AreEqual(e.Days, -1);
     }
     catch (Exception)
     {
         Assert.Fail();
     }
 }