Ejemplo n.º 1
0
        public void CheckRoverCoordsAndDirection_MissingInputWithoutSpace()
        {
            bool result = InputValidator.CheckRoverCoordsAndDirection("45F", out int x, out int y, out Direction direction);

            Assert.AreEqual(false, result);
            Assert.AreEqual(0, x);
            Assert.AreEqual(0, y);
            Assert.AreEqual(Direction.N, direction);
        }
Ejemplo n.º 2
0
        public void CheckRoverCoordsAndDirection_Negative_X_Y_AndCorrectDirectionInputWithSpace()
        {
            bool result = InputValidator.CheckRoverCoordsAndDirection("-4 -5 S", out int x, out int y, out Direction direction);

            Assert.AreEqual(false, result);
            Assert.AreEqual(0, x);
            Assert.AreEqual(0, y);
            Assert.AreEqual(Direction.N, direction);
        }
Ejemplo n.º 3
0
        public void CheckRoverCoordsAndDirection_X_Y_AndWrongDirectionInputWithSpace()
        {
            bool result = InputValidator.CheckRoverCoordsAndDirection("4 5 F", out int x, out int y, out Direction direction);

            Assert.AreEqual(false, result);
            Assert.AreEqual(4, x);
            Assert.AreEqual(5, y);
            Assert.AreEqual(Direction.N, direction);
        }
Ejemplo n.º 4
0
        public void CheckRoverCoordsAndDirection_X_Y_AndCorrectDirectionInputWithSpace()
        {
            bool result = InputValidator.CheckRoverCoordsAndDirection("4 5 S", out int x, out int y, out Direction direction);

            Assert.AreEqual(true, result);
            Assert.AreEqual(4, x);
            Assert.AreEqual(5, y);
            Assert.AreEqual(Direction.S, direction);
        }