public void ReturnInstanceOfCity() { var name = "Name"; var sut = new CityFactory(); var city = sut.Create(name); Assert.IsInstanceOfType(city, typeof(City)); Assert.AreEqual(name, city.Name); }
public static City Get(string cityName, string postalCode, Region region) { City city; if (City.IsInDb(cityName, postalCode)) { city = CityLoader.Load(cityName, postalCode); } else { city = CityFactory.Create(region); city.RecordInDb(); } return(city); }