public void Ctor_PassCommandsWithTheSameName_ThrowsApplicationException(string firstName, string secondName) { // Arrange var firstCommand = VocabularyCommandStubFactory.Name(firstName); var secondCommand = VocabularyCommandStubFactory.Name(firstName); // Assert var ex = Assert.Throws <ApplicationException>( () => new VocabularyRequestHandler(new[] { firstCommand, secondCommand })); Assert.AreEqual(ex.Message, Default.CommandNameDuplicated); }
public void Handle_PassNotContaiedCommandName_ReturnsNoSuchCommand() { // Arrange var handler = new VocabularyRequestHandler( new [] { VocabularyCommandStubFactory.Name("get") }); // Act var result = handler.Handle("add"); // Assert Assert.AreEqual(result, Default.NoSuchCommand); }