예제 #1
0
        public void ToString_Returns_Coordinates_And_Orientation_As_String()
        {
            // Arrange
            _sut = new Position(3, 5, 90);

            // Act
            var result = _sut.ToString();

            // Assert
            Assert.AreEqual("3 5 E ", result);
        }
예제 #2
0
        public void ToString_Returns_String_With_LOST_When_Position_Invalid()
        {
            // Arrange
            _sut = new Position(3, 5, 90);
            _sut.IsValid = false;

            // Act
            var result = _sut.ToString();

            // Assert
            Assert.AreEqual("3 5 E LOST", result);
        }
예제 #3
0
 public Robot(int x, int y, string orientation, IInstructionsParser instructionsParser, Grid grid)
 {
     Position = new Position(x, y, orientation.ToDegrees());
     _instructionsParser = instructionsParser;
     _grid = grid;
 }