public void Should_CommandMatcher_Return_Expected_CommandType() { var commandMatcher = new CommandMatcher(); var areaCommandType = commandMatcher.GetCommandType("5 5"); areaCommandType.Should().BeEquivalentTo(CommandType.AreaCommand); var moveCommandType = commandMatcher.GetCommandType("LMLMLMLMMM"); moveCommandType.Should().BeEquivalentTo(CommandType.MoveCommand); }
public void Throw_Invalid_Command_Exception_Given_Invalid_Command(string invalidCommand) { var commandMatcher = new CommandMatcher(); Assert.Throws <InvalidCommandException>( () => commandMatcher.GetCommandType(invalidCommand)); }
public void Given_valid_command_returns_correct_command_type(string command, CommandType expectedCommandType) { var commandMatcher = new CommandMatcher(); var commandType = commandMatcher.GetCommandType(command); Assert.AreEqual(expectedCommandType, commandType); }
public void Given_invalid_command_throws_CommandException(string invalidCommand) { var commandMatcher = new CommandMatcher(); Assert.Throws <CommandException>( () => commandMatcher.GetCommandType(invalidCommand)); }
public void Should_CommandMatcher_Throw_InvalidCommandStringException() { //Arrange var commandMatcher = new CommandMatcher(); //Act Action action = () => { var response = commandMatcher.GetCommandType("5 5xxxxxxx"); }; //Assert action.Should().Throw <InvalidCommandStringException>(); }
public void Given_invalid_command_throws_CommandException(string invalidCommand) { var commandMatcher = new CommandMatcher(); Assert.Throws<CommandException>( () => commandMatcher.GetCommandType(invalidCommand)); }