コード例 #1
0
        public void TestUpdate()
        {
            DifficultyLevelScale scale           = _dataGenerator.CreateDifficultyLevelScale();
            DifficultyLevel      difficultyLevel = _dataGenerator.CreateDifficultyLevel(difficultyLevelScale: scale);

            difficultyLevel.Name = "newname";

            IDifficultyLevelDao difficultyLevelDao = new DifficultyLevelDao(_graphClient);

            difficultyLevelDao.Save(difficultyLevel);

            Assert.AreEqual("newname", difficultyLevelDao.GetAllIn(scale).First().Name);
        }
コード例 #2
0
        public void TestCreateAndGetAll()
        {
            DifficultyLevelDao   difficultyLevelDao = new DifficultyLevelDao(_graphClient);
            DifficultyLevelScale scale   = _dataGenerator.CreateDifficultyLevelScale();
            DifficultyLevel      created = _dataGenerator.CreateDifficultyLevel(difficultyLevelScale: scale);

            IList <DifficultyLevel> levelsInScale = difficultyLevelDao.GetAllIn(scale);

            Assert.AreEqual(1, levelsInScale.Count);
            Assert.AreEqual(created.Name, levelsInScale.First().Name);
            Assert.AreEqual(created.Id, levelsInScale.First().Id);
            Assert.AreEqual(created.Id, levelsInScale.First().Id);
            Assert.AreEqual(created.Score, levelsInScale.First().Score);
        }