public void TestDeleteInUse()
        {
            DifficultyLevel level     = _dataGenerator.CreateDifficultyLevel();
            Variation       variation = _dataGenerator.CreateVariation(difficultyLevel: level);

            IDifficultyLevelDao dao = new DifficultyLevelDao(_graphClient);
            Action action           = () => dao.Delete(level);

            action.ShouldThrow <NodeInUseException>();
        }
        public void TestRouteIsInUse()
        {
            Route     route     = _dataGenerator.CreateRouteInArea();
            Variation variation = _dataGenerator.CreateVariation(route: route);

            IRoutesDao routesDao = new RouteDao(_graphClient);
            bool       isInUse   = routesDao.IsInUse(route);

            Assert.IsTrue(isInUse);
        }
Beispiel #3
0
        public void TestCreateAndGetAll()
        {
            ILogEntryDao logEntryDao = new LogEntryDao(_graphClient);
            Variation    variation   = _dataGenerator.CreateVariation();
            LogEntry     created     = _dataGenerator.CreateLogEntry(variation: variation);

            IList <LogEntry> logsOnVariation = logEntryDao.GetAllIn(variation);

            Assert.AreEqual(1, logsOnVariation.Count);
            Assert.AreEqual(created.DateTime, logsOnVariation.First().DateTime);
            Assert.AreEqual(created.Id, logsOnVariation.First().Id);
            Assert.AreEqual(created.Memo, logsOnVariation.First().Memo);
        }
        public void TestIsInUse()
        {
            Variation variationWithLogEntry = _dataGenerator.CreateVariation();
            LogEntry  logEntry = _dataGenerator.CreateLogEntry(variationWithLogEntry);

            bool isInUse = new VariationDao(_graphClient).IsInUse(variationWithLogEntry);

            Assert.IsTrue(isInUse);
        }