private static void ValidateTeamCompetitor(teamCompetitor msg, TeamCompetitorCI ci, CultureInfo culture) { Assert.AreEqual(msg.id, ci.Id.ToString()); Assert.AreEqual(msg.name, ci.GetName(culture)); Assert.AreEqual(msg.abbreviation, ci.GetAbbreviation(culture)); Assert.AreEqual(msg.country, ci.GetCountry(culture)); Assert.AreEqual(msg.@virtual, ci.IsVirtual); Assert.AreEqual(msg.qualifier, ci.Qualifier); Assert.AreEqual(msg.divisionSpecified, ci.Division.HasValue); Assert.AreEqual(msg.division, ci.Division); }
public void TeamCompetitorMergeTest() { var teamType1 = new teamCompetitor { abbreviation = "ABC", country = "Germany", id = "sr:team:1", name = "Team A", @virtual = true, virtualSpecified = true, qualifier = "qua 1", divisionSpecified = true, division = 1, state = "state" }; var teamType2 = new teamCompetitor { abbreviation = "ABC", country = "Deutschland", id = "sr:team:1", name = "Team A", @virtual = true, virtualSpecified = true, qualifier = "qua 1", divisionSpecified = true, division = 1, state = "state" }; var competitorDTO1 = new TeamCompetitorDTO(teamType1); var competitorDTO2 = new TeamCompetitorDTO(teamType2); var competitorCI = new TeamCompetitorCI(competitorDTO1, _cultureFirst, new TestDataRouterManager(new CacheManager())); competitorCI.Merge(competitorDTO2, _cultureSecond); Assert.IsNotNull(competitorCI); Assert.AreEqual(competitorCI.Id.ToString(), teamType1.id); Assert.AreEqual(competitorCI.GetName(_cultureFirst), teamType1.name); Assert.AreEqual(competitorCI.GetAbbreviation(_cultureFirst), teamType1.abbreviation); Assert.AreEqual(competitorCI.IsVirtual, teamType1.@virtual); Assert.AreEqual(competitorCI.Qualifier, teamType1.qualifier); Assert.AreEqual(competitorCI.State, teamType1.state); Assert.AreEqual(teamType1.country, competitorCI.GetCountry(_cultureFirst)); Assert.AreEqual(teamType2.country, competitorCI.GetCountry(_cultureSecond)); Assert.IsNotNull(competitorCI.Division); Assert.AreEqual(competitorCI.Division.Value, teamType1.division); }