public void FourLineInstruction_IsCorrect()
        {
            var instructions = new[] { "ULL", "RRDDD", "LURDL", "UUUUD" };

            var keypad = new NineButtonSquareKeypadBuilder().Build("5");

            var sut = new BathroomCodeFinder();

            var code = sut.Code(keypad, () => instructions);

            Assert.Equal("1985", code);
        }
Exemplo n.º 2
0
        public void OneKey_IsCorrect()
        {
            var keypad = new NineButtonSquareKeypadBuilder().Build("1");

            keypad.Reset("1");

            Assert.Equal("1", keypad.Left().Current());

            keypad.Reset("1");
            Assert.Equal("1", keypad.Up().Current());

            keypad.Reset("1");
            Assert.Equal("2", keypad.Right().Current());

            keypad.Reset("1");
            Assert.Equal("4", keypad.Down().Current());
        }