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 TestGetRoutesInSummit() { 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); ISummitDao summitDao = new SummitDao(_graphClient); Summit summit = new Summit {Name = "Gipfel"}; summitDao.Create(summitGroup, summit); IRoutesDao routeDao = new RouteDao(_graphClient); Route created = routeDao.CreateIn(summit, new Route {Name = "Jakobsweg"}); IList<Route> routesInArea = routeDao.GetRoutesIn(summit); Assert.AreEqual(1, routesInArea.Count); Assert.AreEqual("Jakobsweg", routesInArea.First().Name); Assert.AreEqual(created.Name, routesInArea.First().Name); }
public void TestCreateRouteInSummit() { 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); ISummitDao summitDao = new SummitDao(_graphClient); Summit summit = new Summit {Name = "Gipfel"}; summitDao.Create(summitGroup, summit); IRoutesDao routeDao = new RouteDao(_graphClient); Route newRoute = new Route {Name = "Jakobsweg"}; routeDao.CreateIn(summit, newRoute); IList<Route> allRoutes = _graphClient.Cypher.Match("(route:Route)") .Return(route => route.As<Route>()) .Results.ToList(); Assert.AreEqual(1, allRoutes.Count); }
public void TestCreateRouteInArea() { 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); IRoutesDao routeDao = new RouteDao(_graphClient); Route newRoute = new Route {Name = "Jakobsweg"}; routeDao.CreateIn(area, newRoute); IList<Route> allRoutes = _graphClient.Cypher.Match("(route:Route)") .Return(route => route.As<Route>()) .Results.ToList(); Assert.AreEqual(1, allRoutes.Count); }