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); }
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); }