コード例 #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);
        }