public void TestCreateAndGetAll() { Country country = _dataGenerator.CreateCountry(); AreaDao dao = new AreaDao(_graphClient); Area created = _dataGenerator.CreateArea(country: country); IEnumerable <Area> areasInCountry = dao.GetAllIn(country); Assert.AreEqual(1, areasInCountry.Count()); Assert.AreEqual(created.Name, areasInCountry.First().Name); Assert.AreEqual(created.Id, areasInCountry.First().Id); Assert.AreEqual(created.Id, areasInCountry.First().Id); }
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 TestSave() { Country country = _dataGenerator.CreateCountry(); Route route = _dataGenerator.CreateRouteInCountry("oldname", country); IRoutesDao routesDao = new RouteDao(_graphClient); Assert.AreEqual(1, routesDao.GetRoutesIn(country).Count); route.Name = "newname"; routesDao.Save(route); Assert.AreEqual("newname", routesDao.GetRoutesIn(country).First().Name); }