コード例 #1
0
        public void ExecuteWithoutChildrenTest()
        {
            //Arrange
            Quest quest = QuestHelper.CreateQuest();

            quest.IsLeaf = false;

            IsLeafAdjustQuestCommand command = new IsLeafAdjustQuestCommand();

            //Act
            bool result = command.Execute(quest);

            //Assert
            Assert.IsTrue(result);
            Assert.IsTrue(quest.IsLeaf);
        }
コード例 #2
0
        public void ExecuteWithChildrenTest()
        {
            //Arrange
            Quest quest = QuestHelper.CreateQuest();

            quest.IsLeaf   = true;
            quest.Children = new List <Quest> {
                QuestHelper.CreateQuest()
            };

            IsLeafAdjustQuestCommand command = new IsLeafAdjustQuestCommand();

            //Act
            bool result = command.Execute(quest);

            //Assert
            Assert.IsTrue(result);
            Assert.IsFalse(quest.IsLeaf);
        }