コード例 #1
0
        public void CreateFranceMethod_ShouldMakeFrance_WhenCalled()
        {
            ICountry france = CountryFactory.CreateFrance();

            Assert.AreEqual(france.CountryName, "France");
            Assert.AreEqual(france.CapitalName, "Paris");
            Assert.AreEqual(france.CountryInfo,
                            "Official languages: French\n" +
                            "Government: Unitary semi‑presidential republic\n" +
                            "Area: 640,679 km2\n" +
                            "Population: 67,348,000");
            Assert.AreEqual(france.CountryPath, @"Images\Countries\france.png");
        }
コード例 #2
0
        public void LoadCountries()
        {
            ICountry italy    = CountryFactory.CreateItaly();
            ICountry france   = CountryFactory.CreateFrance();
            ICountry bulgaria = CountryFactory.CreateBulgaria();
            ICountry serbia   = CountryFactory.CreateSerbia();
            ICountry germany  = CountryFactory.CreateGermany();
            ICountry brazil   = CountryFactory.CreateBrazil();

            countries.Add(italy);
            countries.Add(france);
            countries.Add(bulgaria);
            countries.Add(serbia);
            countries.Add(germany);
            countries.Add(brazil);

            CountriesDB.Countries = countries;

            ConvertInNewCountry();
        }