예제 #1
0
 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
        public void TestDeleteNotInUse()
        {
            Country country = _dataGenerator.CreateCountry();

            ICountryDao countryDao = new CountryDao(_graphClient);
            countryDao.Delete(country);

            Assert.AreEqual(0, countryDao.GetAll().Count);
        }
예제 #4
0
        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);
        }