예제 #1
0
        public void  ShowReturnCorrectEndDateForReoccurringEvents(int daysHence, EventFrequency freq, int occurences)
        {
            // Arrange
            var date = new DateTime(2017, 12, 25);

            _mockTimeProvider.Setup(o => o.Today()).Returns(date);

            var dateCalculator = new DateCalculator(_mockTimeProvider.Object);

            var testEvent = new Event {
                EventFrequency = freq, Occurences = occurences, EventDate = date
            };

            // Act
            var enddate = dateCalculator.GetEventEndDate(testEvent);

            // Assert
            enddate.Should().Be(testEvent.EventDate.AddDays(daysHence));
        }