public void CommitTest() { //Arrange IQuestTree tree = MockRepository.GenerateStrictMock <IQuestTree>(); LoadChildrenQuestCommand command = new LoadChildrenQuestCommand(tree); //Act bool result = command.Commit(); //Assert Assert.IsTrue(result); tree.VerifyAllExpectations(); }
public void UndoTest() { //Arrange Quest quest = QuestHelper.CreateQuest(); IQuestTree tree = MockRepository.GenerateStrictMock <IQuestTree>(); tree.Expect(tr => tr.UnloadChildren(Arg <Quest> .Is.Equal(quest))).Repeat.Once(); LoadChildrenQuestCommand command = new LoadChildrenQuestCommand(tree); //Act bool result = command.Undo(quest); //Assert Assert.IsTrue(result); tree.VerifyAllExpectations(); }