示例#1
0
        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);
        }
示例#2
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);
        }
示例#3
0
        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);
        }