Beispiel #1
0
        public void IsAtRentAtFreeTime_False()
        {
            var carFacade = new CarFacade("10");
            var date1     = new DateTimeOffset(new DateTime(2018, 10, 06));
            var date2     = new DateTimeOffset(new DateTime(2018, 11, 06));
            var time      = new RentTime(date1, date2);

            var isAtRent = carFacade.IsAtRentAt(time);

            Assert.IsFalse(isAtRent);
        }
Beispiel #2
0
        public void IsAtRentAtBusyTime_True()
        {
            var carFacade = new CarFacade("10");
            var date1     = new DateTimeOffset(new DateTime(2018, 10, 06));
            var date2     = new DateTimeOffset(new DateTime(2018, 11, 06));
            var time      = new RentTime(date1, date2);

            carFacade.Car.Rents.Add(time);
            var isAtRent = carFacade.IsAtRentAt(time);

            Assert.IsTrue(isAtRent);
        }
Beispiel #3
0
        public void IsAtRentAtCrossedTime_True()
        {
            var carFacade = new CarFacade("10");
            var date1     = new DateTimeOffset(new DateTime(2018, 10, 06));
            var date2     = new DateTimeOffset(new DateTime(2018, 11, 06));
            var date3     = new DateTimeOffset(new DateTime(2018, 10, 31));
            var date4     = new DateTimeOffset(new DateTime(2019, 02, 26));
            var time1     = new RentTime(date1, date2);
            var time2     = new RentTime(date3, date4);

            carFacade.Car.Rents.Add(time1);
            var isAtRent = carFacade.IsAtRentAt(time2);

            Assert.IsTrue(isAtRent);
        }