/// <summary> /// Initializes a new instance of the <see cref="Referee"/> class. /// </summary> /// <param name="ci">A <see cref="RefereeCI"/> used to create new instance</param> /// <param name="cultures">A cultures of the current instance of <see cref="Referee"/></param> internal Referee(RefereeCI ci, IEnumerable <CultureInfo> cultures) { var cultureList = cultures as IList <CultureInfo> ?? cultures.ToList(); Id = ci.Id; Name = ci.Name; Nationalities = new ReadOnlyDictionary <CultureInfo, string>( cultureList.Where(c => ci.GetNationality(c) != null).ToDictionary(c => c, ci.GetNationality)); }
public void RefereeTest() { var refereeType = new referee { id = "sr:referee:1", name = "John Doe", nationality = "German", }; var refereeDTO = new RefereeDTO(refereeType); var refereeCI = new RefereeCI(refereeDTO, _cultureFirst); Assert.IsNotNull(refereeCI); Assert.AreEqual(refereeType.id, refereeCI.Id.ToString()); Assert.AreEqual(refereeType.name, refereeCI.Name); Assert.AreEqual(refereeType.nationality, refereeCI.GetNationality(_cultureFirst)); }