public void TestKeyAvailable()
        {
            FakeIInput   fakeConsole  = new FakeIInput(Input.Left);
            InputChecker inputChecker = new InputChecker(fakeConsole);

            Assert.AreEqual(inputChecker.InputAvailable, true);
        }
Beispiel #2
0
        public void Initialize()
        {
            var input   = new FakeIInput(Input.NoInput);
            var display = new FakeIDisplay();

            _main = new TetfuzaMenu(input, display);
        }
        public void TestGetInputRotationLeft()
        {
            int          xDir         = 0;
            int          yDir         = 0;
            int          rot          = 0;
            FakeIInput   fakeConsole  = new FakeIInput(Input.RotateCounterClockwise);
            InputChecker inputChecker = new InputChecker(fakeConsole);

            inputChecker.GetInput(ref xDir, ref yDir, ref rot);
            Assert.AreEqual(xDir, 0);
            Assert.AreEqual(yDir, 0);
            Assert.AreEqual(rot, -1);
        }
        public void TestGetInputClear()
        {
            int xDir = 0;
            int yDir = 0;
            int rot  = 0;

            FakeIInput   fakeConsole  = new FakeIInput(Input.Option);
            InputChecker inputChecker = new InputChecker(fakeConsole);

            inputChecker.GetInput(ref xDir, ref yDir, ref rot);

            Assert.AreEqual(fakeConsole.ClearCalled, true);
        }
        public void TestGetInputDirectionLeft()
        {
            int xDir = 0;
            int yDir = 0;
            int rot  = 0;

            FakeIInput   fakeConsole  = new FakeIInput(Input.Left);
            InputChecker inputChecker = new InputChecker(fakeConsole);

            inputChecker.GetInput(ref xDir, ref yDir, ref rot);

            Assert.AreEqual(xDir, -1);
            Assert.AreEqual(rot, 0);
            Assert.AreEqual(yDir, 0);
        }
        public void TestNoValidInput()
        {
            int xDir = 0;
            int yDir = 0;
            int rot  = 0;

            FakeIInput   fakeConsole  = new FakeIInput(Input.NoInput);
            InputChecker inputChecker = new InputChecker(fakeConsole);

            inputChecker.GetInput(ref xDir, ref yDir, ref rot);

            Assert.AreEqual(xDir, 0);
            Assert.AreEqual(rot, 0);
            Assert.AreEqual(yDir, 0);
        }
        public void Initialize()
        {
            FakeIInput fakeConsole = new FakeIInput(Input.RotateCounterClockwise);

            _inputChecker = new InputChecker(fakeConsole);
        }