예제 #1
0
        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 TestCreateAndGetAll()
 {
     IDifficultyLevelScaleDao dao = new DifficultyLevelScaleDao(_graphClient);
     DifficultyLevelScale difficultyLevelScale = new DifficultyLevelScale() {Name = "sächsisch"};
     DifficultyLevelScale created = dao.Create(difficultyLevelScale);
     IList<DifficultyLevelScale> allDifficultyLevelScales = dao.GetAll();
     Assert.AreEqual(1, allDifficultyLevelScales.Count);
     Assert.AreEqual(difficultyLevelScale.Name, allDifficultyLevelScales.First().Name);
     Assert.AreEqual(difficultyLevelScale.Id, allDifficultyLevelScales.First().Id);
     Assert.AreEqual(created.Id, allDifficultyLevelScales.First().Id);
 }