示例#1
0
        public void CompetitorTest()
        {
            var teamType1 = new team
            {
                abbreviation     = "ABC",
                country          = "Germany",
                id               = SR.Urn("team").ToString(),
                name             = "Team A",
                @virtual         = true,
                virtualSpecified = true
            };
            var teamType2 = new team
            {
                abbreviation     = "ABC",
                country          = "Deutschland",
                id               = SR.Urn("team").ToString(),
                name             = "Team A",
                @virtual         = true,
                virtualSpecified = true
            };
            var competitorDTO1 = new CompetitorDTO(teamType1);
            var competitorDTO2 = new CompetitorDTO(teamType2);

            var competitorCI = new CompetitorCI(competitorDTO1, _cultureFirst, null);

            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(teamType1.country, competitorCI.GetCountry(_cultureFirst));
            Assert.AreEqual(teamType2.country, competitorCI.GetCountry(_cultureSecond));
        }
 public override string GetName(CultureInfo culture)
 {
     GetOrLoadCompetitor();
     return(_names != null
                ? base.GetName(culture)
                : _competitorCI.GetName(culture));
 }