public void GeoNames_Toponym_AlternateNamesList_ShouldSetAlternateNamesReadOnlyCollection() { var it = new Toponym { AlternateNamesList = new List <AlternateName> { new AlternateName { Name = "name 1", }, new AlternateName { Name = "name 2", }, new AlternateName { Name = "name 3", }, } }; it.ShouldNotBeNull(); it.AlternateNamesList.ShouldNotBeNull(); it.AlternateNamesList.Count.ShouldEqual(3); it.AlternateNames.ShouldNotBeNull(); it.AlternateNames.Count.ShouldEqual(it.AlternateNamesList.Count); for (var i = 0; i < it.AlternateNames.Count; i++) { it.AlternateNames[i].Name.ShouldEqual(it.AlternateNamesList[i].Name); } }
public void GeoNames_Toponym_ShouldOverrideToString() { var model = new Toponym { Name = "name", }; model.ShouldNotBeNull(); model.ToString().ShouldEqual(model.Name); }
public void GeoNames_Toponym_StringProperties_ShouldBeConvertedToNull_WhenEmptyOrWhiteSpace() { var model = new Toponym { CountryName = " ", Admin1Name = " ", Admin2Name = " ", Admin3Name = " ", Admin4Name = " ", }; model.ShouldNotBeNull(); model.CountryName.ShouldBeNull(); model.Admin1Name.ShouldBeNull(); model.Admin2Name.ShouldBeNull(); model.Admin3Name.ShouldBeNull(); model.Admin4Name.ShouldBeNull(); }
public void GeoNames_Toponym_AlternateNamesList_ShouldSetAlternateNamesReadOnlyCollection() { var it = new Toponym { AlternateNamesList = new List<AlternateName> { new AlternateName { Name = "name 1", }, new AlternateName { Name = "name 2", }, new AlternateName { Name = "name 3", }, } }; it.ShouldNotBeNull(); it.AlternateNamesList.ShouldNotBeNull(); it.AlternateNamesList.Count.ShouldEqual(3); it.AlternateNames.ShouldNotBeNull(); it.AlternateNames.Count.ShouldEqual(it.AlternateNamesList.Count); for (var i = 0; i < it.AlternateNames.Count; i++) it.AlternateNames[i].Name.ShouldEqual(it.AlternateNamesList[i].Name); }
public void GeoNames_Toponym_ShouldBePublic() { var model = new Toponym(); model.ShouldNotBeNull(); }