예제 #1
0
        public void RepoLeagueTestsGetLeagueByStartDate()
        {
            List <League> LeagueDB = new List <League>
            {
                new League {
                    LeagueID = 0, GamesPerWeek = 2, StartDate = new DateTime(2016, 05, 02)
                },
                new League {
                    LeagueID = 1, GamesPerWeek = 1, GameTitle = "Halo", SeasonLength = 4, StartDate = new DateTime(2016, 05, 01)
                },
                new League {
                    LeagueID = 2, GamesPerWeek = 1, GameTitle = "COD", SeasonLength = 4, StartDate = new DateTime(2016, 05, 01)
                },
                new League {
                    LeagueID = 3, GamesPerWeek = 1, GameTitle = "Halo", SeasonLength = 5, StartDate = new DateTime(2016, 05, 02)
                }
            };
            List <League> expected = new List <League>
            {
                new League {
                    LeagueID = 1, GamesPerWeek = 1, GameTitle = "Halo", SeasonLength = 4, StartDate = new DateTime(2016, 05, 01)
                },
                new League {
                    LeagueID = 2, GamesPerWeek = 1, GameTitle = "COD", SeasonLength = 4, StartDate = new DateTime(2016, 05, 01)
                }
            };

            _leagueSet.Object.AddRange(LeagueDB);
            ConnectMocksToDataStore(LeagueDB);
            List <League> actual = _repo.GetLeaguesByStartDate(new DateTime(2016, 05, 01));

            CollectionAssert.AreEqual(expected, actual);
        }