public void GetSeriesResultsByMatchRoundTest() { const int season = 30; const int htSeriesId = 1000; var country = TestEntities.CreateCountry(66, "EnglishName", "CountryName"); var series = TestEntities.CreateSeries(htSeriesId, country, "SeriesName"); var matches = new List<Match> { TestEntities.CreateMatchFullData(1000, country, 1050, 1051, new List<int>(), 1500, 1 ), TestEntities.CreateMatchFullData(1001, country, 1052, 1053, new List<int>(), 1500, 1 ), TestEntities.CreateMatchFullData(1002, country, 1054, 1055, new List<int>(), 1500, 2 ) }; matches.ForEach(series.AddMatch); var sessionFactory = SessionFactory.CreateSessionFactory(true); using (var session = sessionFactory.OpenSession()) { using (session.BeginTransaction()) { session.SaveOrUpdate(country); session.SaveOrUpdate(series); session.Transaction.Commit(); } } var seriesRepository = new SeriesRepository(SessionManager.CurrentSession); var matchesFromDb = seriesRepository.GetSeriesResults(htSeriesId, season, 1); Assert.True(matchesFromDb.Count == 2); }