Пример #1
0
        public void remain_on_5_if_given_up_or_down_or_left_command_from_starting_position(string move)
        {
            var keypad = new ModifiedKeypad();

            keypad.Move(move);

            Assert.AreEqual('5', keypad.CurrentValue);
        }
Пример #2
0
        public void move_to_6_if_given_right_command_from_starting_position(string move)
        {
            var keypad = new ModifiedKeypad();

            keypad.Move(move);

            Assert.AreEqual('6', keypad.CurrentValue);
        }
Пример #3
0
        public void move_down_when_given_down_command_from_starting_position_of_7(string move, int expectedValue)
        {
            var keypad = new ModifiedKeypad
            {
                XPosition = 2,
                YPosition = 2
            };

            keypad.Move(move);

            Assert.AreEqual(expectedValue, keypad.CurrentValue);
        }
Пример #4
0
        public void return_code_when_given_sequence_of_commands()
        {
            var commands = new[] { "ULL", "RRDDD", "LURDL", "UUUUD" };

            var keypad = new ModifiedKeypad();

            var expectedCode = "5DB3";

            var actualCode = keypad.Decode(commands);

            Assert.AreEqual(expectedCode, actualCode);
        }
Пример #5
0
        public void start_at_5()
        {
            var keypad = new ModifiedKeypad();

            Assert.AreEqual('5', keypad.CurrentValue);
        }