public void DoneQuestCommandTest() { //Arrange IQuestTree repository = MockRepository.GenerateStrictMock <IQuestTree>(); Quest quest = MockRepository.GeneratePartialMock <Quest>(); IStateCommandsFactory factory = new DefaultStateCommandsFactory(repository); //Act ICommand command = factory.DoneQuest(quest); //Assert Assert.AreEqual(typeof(UpToRootQuestCommand), command.GetType()); }
public void CancelFailTest() { //Arrange IQuestTree repository = MockRepository.GenerateStrictMock <IQuestTree>(); IStateCommandsFactory factory = new DefaultStateCommandsFactory(repository); //Act ArgumentNullException ex = Assert.Throws <ArgumentNullException>(() => factory.CancelQuest(null)); //Assert Assert.IsNotNull(ex); Assert.AreEqual("quest", ex.ParamName); }