Ejemplo n.º 1
0
        public void GetItems_Returns_No_Items(int numItems, int year, int month, int day)
        {
            //Given
            var calendarItemProvider = InterfaceMocks.NthWeekdayOfMonthCalendarItemMock(numItems);
            var dateProvider         = InterfaceMocks.DateMock(new DateTime(year, month, day));
            var getCalendarItems     = new GetCalendarItems(calendarItemProvider, dateProvider);

            var items = getCalendarItems.GetItems();

            //Then
            Assert.Empty(items);
        }
Ejemplo n.º 2
0
        [InlineData(2, 1, 2020, 06, 21 - 3)]  // correct
        public void GetItems_Returns_Calendar_Item_Exactly_Three_Days_Away(int numItems, int index, int year, int month, int day)
        {
            //Given
            var calendarItemProvider = InterfaceMocks.NthWeekdayOfMonthCalendarItemMock(numItems);
            var dateProvider         = InterfaceMocks.DateMock(new DateTime(year, month, day));
            var getCalendarItems     = new GetCalendarItems(calendarItemProvider, dateProvider);

            //When
            var items = getCalendarItems.GetItems();

            //Then
            var actual   = items.First();
            var expected = NthWeekdayOfMonthSampleData.SampleDates(numItems) [index];

            Assert.True(IsEqual(expected as NthWeekdayOfMonthCalendarItem, actual, year));
        }