public void GetCountriesInNorthAmericaTest()
        {
            //Arrange
            CountrySqlDAL countrySqlDal = new CountrySqlDAL(connectionString);

            //Act
            List <Country> countries = countrySqlDal.GetCountriesInNorthAmerica();

            //Assert
            Assert.IsNotNull(countries);
            Assert.AreEqual(countriesInNorthAmerica + 1, countries.Count);
        }
        public void GetContinentNamesTest()
        {
            //Arrange
            CountrySqlDAL countrySqlDal = new CountrySqlDAL(connectionString);

            //Act
            List <string> names = countrySqlDal.GetContinentNames();

            //Assert
            Assert.IsNotNull(names);
            Assert.AreEqual(7, names.Count);
        }
        private void GetCountriesInNorthAmerica()
        {
            CountrySqlDAL countryDal = new CountrySqlDAL(DatabaseConnectionString);

            List <Country> northAmericanCountries = countryDal.GetCountriesInNorthAmerica();

            Console.WriteLine();
            Console.WriteLine("All North American Countries");

            foreach (var country in northAmericanCountries)
            {
                Console.WriteLine(country);
            }
        }
        private void GetContinentNames()
        {
            CountrySqlDAL countryDal = new CountrySqlDAL(DatabaseConnectionString);

            List <string> continents = countryDal.GetContinentNames();

            Console.WriteLine();
            Console.WriteLine("Printing all of the continents");

            for (int index = 0; index < continents.Count; index++)
            {
                Console.WriteLine(index + " - " + continents[index]);
            }
        }
Esempio n. 5
0
        private void GetCountriesInNorthAmerica()
        {
            CountrySqlDAL countryDal = new CountrySqlDAL(DatabaseConnectionString);

            List <Country> northAmericanCountries = countryDal.GetCountriesInNorthAmerica();

            Console.WriteLine();
            Console.WriteLine("All North American Countries");

            foreach (Country c in northAmericanCountries)
            {
                Console.WriteLine(c.Code.PadRight(5) + c.Name.PadRight(20) + c.Continent.PadRight(30) + c.SurfaceArea.ToString("N2").PadRight(10) + c.Population.ToString("N0").PadRight(15) + c.GovernmentForm.PadRight(30));
            }
        }