Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public void Throw_Invalid_Command_Exception_Given_Invalid_Command(string invalidCommand)
        {
            var commandMatcher = new CommandMatcher();

            Assert.Throws <InvalidCommandException>(
                () => commandMatcher.GetCommandType(invalidCommand));
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
            public void Given_invalid_command_throws_CommandException(string invalidCommand)
            {
                var commandMatcher = new CommandMatcher();

                Assert.Throws <CommandException>(
                    () => commandMatcher.GetCommandType(invalidCommand));
            }
Ejemplo n.º 5
0
        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>();
        }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 public void Given_invalid_command_throws_CommandException(string invalidCommand)
 {
     var commandMatcher = new CommandMatcher();
     Assert.Throws<CommandException>(
         () => commandMatcher.GetCommandType(invalidCommand));
 }