Esempio n. 1
0
        public void GetFreeCarListOnTwoDates_ShouldReturnRightList()
        {
            //arrange
            CarRentCenter carCenter = new CarRentCenter();
            var           firstCar  = new Car("model_1", "color_1");
            var           secondCar = new Car("model_2", "color_2");

            firstCar.getDateOfRent().Add(new DateOfRent(new DateTime(2017, 10, 2), new DateTime(2017, 10, 7)));
            firstCar.getDateOfRent().Add(new DateOfRent(new DateTime(2017, 10, 9), new DateTime(2017, 10, 23)));
            secondCar.getDateOfRent().Add(new DateOfRent(new DateTime(2017, 10, 2), new DateTime(2017, 10, 7)));
            secondCar.getDateOfRent().Add(new DateOfRent(new DateTime(2017, 10, 9), new DateTime(2017, 10, 26)));
            carCenter.getCarList().Add(firstCar);
            carCenter.getCarList().Add(secondCar);
            var expected = new List <Car> {
                firstCar
            };

            //act
            var answer = (List <Car>)carCenter.CheckingFree(new DateTime(2017, 10, 25), new DateTime(2017, 10, 30));

            //assert
            CollectionAssert.AreEqual(expected, answer);
        }
Esempio n. 2
0
 public void ShowAllCars()
 {
     carCenter.getCarList();
 }