public void TestGetAll() { CountryDao dao = new CountryDao(_graphClient); Country created = _dataGenerator.CreateCountry(); IEnumerable<Country> allCountries = dao.GetAll(); Assert.AreEqual(1, allCountries.Count()); Assert.AreEqual(created.Name, allCountries.First().Name); Assert.AreEqual(created.Id, allCountries.First().Id); }
public void TestCreateAndReturn() { CountryDao dao = new CountryDao(_graphClient); Country newCountry = new Country() { Name = "Deutschland" }; Country created = dao.Create(newCountry); IEnumerable<Country> allCountries = dao.GetAll(); Assert.AreEqual(1, allCountries.Count()); Assert.AreEqual(created.Id, allCountries.First().Id); }
public void TestDeleteNotInUse() { Country country = _dataGenerator.CreateCountry(); ICountryDao countryDao = new CountryDao(_graphClient); countryDao.Delete(country); Assert.AreEqual(0, countryDao.GetAll().Count); }
public void TestUpdate() { Country country = _dataGenerator.CreateCountry(); country.Name = "newname"; ICountryDao countryDao = new CountryDao(_graphClient); countryDao.Save(country); Assert.AreEqual("newname", countryDao.GetAll().First().Name); }