public void MigrateSeriesDetailsTest() { const int htCountryId = 66; var country = TestEntities.CreateCountry(htCountryId, "EnglishName", "countryName"); var supportedIds = TestEntities.CreateSupportedIdList(); for (int i = 0; i < 3; i++) { country.AddSeriesId(supportedIds[i]); } var sessionFactory = SessionFactory.CreateSessionFactory(true); using (var session = sessionFactory.OpenSession()) { session.SaveOrUpdate(country); session.Flush(); } var service = new MigrateToNhibernateDomainService(SessionManager.CurrentSession); service.MigrateLeagueDetails(htCountryId); using (var session = sessionFactory.OpenSession()) { var leagues = session.CreateCriteria<Series>() .Add(Restrictions.Eq("Country.CountryId", country.CountryId)) .List<Series>(); Assert.True(leagues.Count > 0); } }
public void MigrateSeriesDetails(int countryId) { var migrationService = new MigrateToNhibernateDomainService(_session); migrationService.MigrateLeagueDetails(countryId); }