Пример #1
0
        public void Calculate_EligibleStartTimeButIneligibleEndTime_NotEligible()
        {
            // ARRANGE
            var requests =
                new[]
            {
                new CalculateRequest(IncMinStartDateTime, IncMinEndDateTime.AddMilliseconds(-1)),
                new CalculateRequest(ExclMaxStartDateTime.AddMilliseconds(-1), ExclMaxEndDateTime),
            };

            // ACT
            var responses = requests.Select(i => SUT.Calculate(i)).ToList();

            // ASSERT
            Assert.IsTrue(responses.All(i => i == null));
        }
Пример #2
0
        public void Calculate_EligibleStartTimeAndEligibleEndTime_CorrectPrice()
        {
            // ARRANGE
            var requests =
                new[]
            {
                new CalculateRequest(IncMinStartDateTime, IncMinEndDateTime),
                new CalculateRequest(ExclMaxStartDateTime.AddMilliseconds(-1), ExclMaxEndDateTime.AddMilliseconds(-1)),
            };

            // ACT
            var responses = requests.Select(request => SUT.Calculate(request)).ToList();

            // ASSERT
            Assert.IsTrue(responses.All(i => i.Price == 13M));
            Assert.IsTrue(responses.All(i => string.Equals(i.RateName, "Early Bird")));
        }