public void TestGetRoutesInSummitGroup() { ICountryDao countryDao = new CountryDao(_graphClient); Country country = new Country { Name = "Deutschland" }; countryDao.Create(country); IAreaDao areaDao = new AreaDao(_graphClient); Area area = new Area(); areaDao.Create(country, area); ISummitGroupDao summitGroupDao = new SummitGroupDao(_graphClient); SummitGroup summitGroup = new SummitGroup { Name = "Gipfelgruppe" }; summitGroupDao.Create(area, summitGroup); IRoutesDao routeDao = new RouteDao(_graphClient); Route created = routeDao.CreateIn(summitGroup, new Route { Name = "Jakobsweg" }); IList <Route> routesInArea = routeDao.GetRoutesIn(summitGroup); Assert.AreEqual(1, routesInArea.Count); Assert.AreEqual("Jakobsweg", routesInArea.First().Name); Assert.AreEqual(created.Name, routesInArea.First().Name); }
public void TestCreateRouteInSummitGroup() { ICountryDao countryDao = new CountryDao(_graphClient); Country newCountry = new Country { Name = "Deutschland" }; countryDao.Create(newCountry); IAreaDao areaDao = new AreaDao(_graphClient); Area area = new Area(); areaDao.Create(newCountry, area); ISummitGroupDao summitGroupDao = new SummitGroupDao(_graphClient); SummitGroup summitGroup = new SummitGroup { Name = "Gipfelgruppe" }; summitGroupDao.Create(area, summitGroup); IRoutesDao routeDao = new RouteDao(_graphClient); Route newRoute = new Route { Name = "Jakobsweg" }; routeDao.CreateIn(summitGroup, newRoute); IList <Route> allRoutes = _graphClient.Cypher.Match("(route:Route)") .Return(route => route.As <Route>()) .Results.ToList(); Assert.AreEqual(1, allRoutes.Count); }
public Country CreateCountry(string name = "Land") { CountryDao dao = new CountryDao(_graphClient); Country newCountry = new Country() { Name = name }; return(dao.Create(newCountry)); }
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 TestCreateAndGetAll() { ICountryDao countryDao = new CountryDao(_graphClient); Country country = new Country() { Name = "D" }; countryDao.Create(country); IRoutesDao routeDao = new RouteDao(_graphClient); Route route = new Route() { Name = "Route1" }; routeDao.CreateIn(country, route); IDifficultyLevelScaleDao scaleDao = new DifficultyLevelScaleDao(_graphClient); DifficultyLevelScale scale = new DifficultyLevelScale() { Name = "sächsisch" }; scaleDao.Create(scale); IDifficultyLevelDao levelDao = new DifficultyLevelDao(_graphClient); DifficultyLevel level = new DifficultyLevel() { Name = "7b" }; levelDao.Create(scale, level); IVariationDao variationDao = new VariationDao(_graphClient); Variation variation = new Variation() { Name = "Ein Weg der Route1 als 7b" }; Variation created = variationDao.Create(variation, route, level); IList <Variation> variationsOnRoute = variationDao.GetAllOn(route); Assert.AreEqual(1, variationsOnRoute.Count); Assert.AreEqual(variation.Name, variationsOnRoute.First().Name); Assert.AreEqual(variation.Id, variationsOnRoute.First().Id); Assert.AreEqual(created.Id, variationsOnRoute.First().Id); }
public void TestGetRoutesInCountry() { ICountryDao countryDao = new CountryDao(_graphClient); Country country = new Country { Name = "Deutschland" }; countryDao.Create(country); IRoutesDao routeDao = new RouteDao(_graphClient); Route created = routeDao.CreateIn(country, new Route { Name = "Jakobsweg" }); IList <Route> routesInCountry = routeDao.GetRoutesIn(country); Assert.AreEqual(1, routesInCountry.Count); Assert.AreEqual("Jakobsweg", routesInCountry.First().Name); Assert.AreEqual(created.Name, routesInCountry.First().Name); }
public void TestCreateRouteInCountry() { ICountryDao countryDao = new CountryDao(_graphClient); Country newCountry = new Country { Name = "Deutschland" }; countryDao.Create(newCountry); IRoutesDao routeDao = new RouteDao(_graphClient); Route newRoute = new Route { Name = "Jakobsweg" }; routeDao.CreateIn(newCountry, newRoute); IList <Route> allRoutes = _graphClient.Cypher.Match("(route:Route)") .Return(route => route.As <Route>()) .Results.ToList(); Assert.AreEqual(1, allRoutes.Count); }