private void GetCountries() { IList <Country> countries = countryDAO.GetCountries(); Console.WriteLine(); Console.WriteLine("Printing all of the countries"); for (int index = 0; index < countries.Count; index++) { Console.WriteLine(index + " - " + countries[index]); } }
public void GetCountriesByContinent_Should_ReturnCorrectNumberOfCountries(string continent, int expectedCount) { CountrySqlDAO dao = new CountrySqlDAO(ConnectionString); IList <Country> countries = dao.GetCountries(continent); Assert.AreEqual(expectedCount, countries.Count); }
public void GetCountriesTest_Should_ReturnAllCountries() { // Arrange CountrySqlDAO dao = new CountrySqlDAO(ConnectionString); // Act IList <Country> countries = dao.GetCountries(); // Assert Assert.AreEqual(1, countries.Count); }
public void GetCountriesTest_Should_ReturnAllCountries() { // Arrange CountrySqlDAO dao = new CountrySqlDAO(this.connectionString); // Act IList <Country> list = dao.GetCountries(); // Assert - Country count Assert.AreEqual(3, list.Count); }
public void GetCountriesByContinent_Should_ReturnCorrectNumberOfCountries(string continent, int expectedCount) { // Arrange CountrySqlDAO dao = new CountrySqlDAO(this.connectionString); // Act IList <Country> list = dao.GetCountries(continent); // Assert - Country count Assert.AreEqual(expectedCount, list.Count); }
public void GetCountriesByContinent_Should_ReturnCorrectNumberOfCountries(string continent, int expectedCount) { // Arrange CountrySqlDAO country = new CountrySqlDAO(ConnectionString); // Act IList <Country> countryList = country.GetCountries(continent); // Assert Assert.AreEqual(expectedCount, countryList.Count); }
public void GetCountriesInNorthAmericaTest() { // Arrange CountrySqlDAO countrySqlDAO = new CountrySqlDAO(ConnectionString); // Act IList <Country> countries = countrySqlDAO.GetCountries("North America"); // Assert Assert.IsTrue(countries.Count > 0); }
public void GetCountriesTest_Should_ReturnAllCountries() { // Arrange CountrySqlDAO dao = new CountrySqlDAO(ConnectionString); // Act IList <Country> countries = dao.GetCountries(); // Assert Assert.AreEqual(numCountries, countries.Count); // Some will argue this is sufficient Assert.IsTrue(countries.Count > 0); }
public void GetCountriesByContinentTest() { // Arrange // Act // Call the GetCountries method List <Country> countries = dao.GetCountries("North America"); //Assert // Make sure we get back the country we expect Assert.IsNotNull(countries); Assert.AreEqual(2, countries.Count); }
public void GetCountriesByContinentTest() { //arrange //Establish the "known state" of the database //SetupDB(); ////Create and instance of CountrySqlDAO //CountrySqlDAO dao = new CountrySqlDAO(connectionString); //act //Call the GetCountries method List <Country> countries = dao.GetCountries("North America"); //assert //Make sure we get back the country we expect Assert.IsNotNull(countries); Assert.AreEqual(2, countries.Count); }
public void GetCountryHasCorrectValues() { //arrange CountrySqlDAO dao = new CountrySqlDAO(ConnectionString); //act IList <Country> countries = dao.GetCountries("North America"); string expectedRegion = "Region"; string actualRegion = ""; foreach (Country country in countries) { if (country.Code == "USA") { actualRegion = country.Region; } } //ASSERT Assert.AreEqual(expectedRegion, actualRegion); }