public void CommitTestTest(bool beforeCommitResult, bool afterCommitResult) { //Arrange Quest quest = QuestHelper.CreateQuest(); IQuestCommand beforeQuestCommanduestCommand = MockRepository.GenerateStrictMock <IQuestCommand>(); beforeQuestCommanduestCommand.Expect(bqc => bqc.Commit()). Repeat.Once(). Return(beforeCommitResult); IQuestCommand afterQuestCommand = MockRepository.GenerateStrictMock <IQuestCommand>(); afterQuestCommand.Expect(aqc => aqc.Commit()). Repeat.Once(). Return(afterCommitResult); DownHierarchyQuestCommand command = new DownHierarchyQuestCommand(quest, beforeQuestCommanduestCommand, afterQuestCommand); //Act bool result = command.Commit(); //Assert Assert.AreEqual(beforeCommitResult && afterCommitResult, result); beforeQuestCommanduestCommand.VerifyAllExpectations(); afterQuestCommand.VerifyAllExpectations(); }