public void T1_creating_named_cities() { Action a = () => CityFactory.CreateCity(null); a.ShouldThrow <ArgumentException>(); Action ab = () => CityFactory.CreateCity(String.Empty); ab.ShouldThrow <ArgumentException>(); { ICity s = CityFactory.CreateCity("Paris"); s.Name.Should().BeEquivalentTo("Paris"); } { var randomName = Guid.NewGuid().ToString(); ICity s = CityFactory.CreateCity(randomName); s.Name.Should().BeEquivalentTo(randomName); } ICity s1 = CityFactory.CreateCity("getType"); s1.GetType().GetProperty("Name").GetSetMethod().Should().BeNull("City.Name must NOT be writeable."); s1.GetType().GetConstructors(BindingFlags.Instance | BindingFlags.Public).Should().BeEmpty("Company must not expose any public constructors."); }