public void MigrateLeagueDetails(List<int> seriesIdList) { var seriesDetails = new List<LeagueDetails>(); foreach (int seriesId in seriesIdList) { var leagueDetailsRaw = new CHPP.Files.HattrickFileAccessors. LeagueDetails(ProtectedResourceUrl) { LeagueLevelUnitID = seriesId }; var request = new WhoScoredRequest(); string response = request.MakeRequest(leagueDetailsRaw.GetHattrickFileAccessorAbsoluteUri()); seriesDetails.Add(LeagueDetails.Deserialize(response)); } var dbService = new WhoScoredRepository(); dbService.SaveSeriesDetails(seriesDetails); }
public void MigrateLeagueDetailsTest_FromXmlToDb() { string strFile = "leaguedetails.xml"; string response = GetXmlString(strFile); var leagueDetailsInput = CHPP.LeagueDetails.Serializer.HattrickData.Deserialize(response); IWhoScoredRepository repository = new WhoScoredRepository(); repository.SaveSeriesDetails(leagueDetailsInput); Thread.Sleep(1000); var worldDetailsCount = repository.GetSeriesDetails<CHPP.LeagueDetails.Serializer.HattrickData>().Count; repository.DropSeriesDetails(); Assert.AreEqual(1, worldDetailsCount); }