예제 #1
0
        public void TestNightLifeHourspanToBig()
        {
            NightLife nightlife            = new NightLife(100);
            DateTime  reservationDateStart = new DateTime(2020, 01, 23, 22, 00, 00);
            DateTime  reservationDateEnd   = new DateTime(2020, 01, 24, 11, 00, 00);
            int       firstHourPrice       = 10;
            Action    act = () => nightlife.GetHours(reservationDateStart, reservationDateEnd, firstHourPrice);

            act.ShouldThrow <ArgumentException>().Message.ShouldBe("Tijdsduur kan maximum 11 uur zijn.");
        }
예제 #2
0
        public void TestNightLifeStartDateInRange()
        {
            NightLife nightlife            = new NightLife(100);
            DateTime  reservationDateStart = new DateTime(2020, 01, 23, 21, 00, 00);
            DateTime  reservationDateEnd   = new DateTime(2020, 01, 24, 6, 00, 00);
            int       firstHourPrice       = 10;
            Action    act = () => nightlife.GetHours(reservationDateStart, reservationDateEnd, firstHourPrice);

            act.ShouldNotThrow();
        }
예제 #3
0
        public void TestNightLifeStartDateToBig()
        {
            NightLife nightlife            = new NightLife(100);
            DateTime  reservationDateStart = new DateTime(2020, 01, 23, 2, 00, 00);
            DateTime  reservationDateEnd   = new DateTime(2020, 01, 23, 9, 00, 00);
            int       firstHourPrice       = 10;
            Action    act = () => nightlife.GetHours(reservationDateStart, reservationDateEnd, firstHourPrice);

            act.ShouldThrow <ArgumentException>().Message.ShouldBe("Startreservatie moet tussen 20 uur en 0 uur zitten.");
        }
예제 #4
0
        public void TestNightLifeReturnsCorrectHours()
        {
            NightLife   nightlife            = new NightLife(100);
            DateTime    reservationDateStart = new DateTime(2020, 01, 23, 21, 00, 00);
            DateTime    reservationDateEnd   = new DateTime(2020, 01, 24, 6, 00, 00);
            int         firstHourPrice       = 10;
            List <Hour> hours = nightlife.GetHours(reservationDateStart, reservationDateEnd, firstHourPrice);

            hours[0].Period.ShouldBe(7);
            hours[0].UnitPrice.ShouldBe(100);
            hours[1].Period.ShouldBe(2);
            hours[1].UnitPrice.ShouldBe(15);
        }
예제 #5
0
        public void TestWellnessGetHoursInvalidValuePrice()
        {
            //Arrange = initialisatie obejcten/methodes
            NightLife nightlife            = new NightLife(null);
            DateTime  reservationDateStart = new DateTime(2020, 01, 23, 21, 00, 00);
            DateTime  reservationDateEnd   = new DateTime(2020, 01, 24, 4, 00, 00);
            int       firstHourPrice       = 10;
            //Act roept test methode op met ingestelde parameters
            Action act = () => nightlife.GetHours(reservationDateStart, reservationDateEnd, firstHourPrice);

            //Assert verifieert of juist
            act.ShouldThrow <InvalidOperationException>().Message.ShouldBe("Arrangement niet beschikbaar");
        }