Пример #1
0
        /// <summary>
        /// Returns the rover position and heading in string format
        /// </summary>
        /// <param name="rover"></param>
        /// <returns></returns>
        private string GetRoverPositionAndHeadingString(IRover rover)
        {
            var position = _roverService.GetRoverPosition(rover);
            var heading  = _roverService.GetRoverHeading(rover);

            return($"{position.X} {position.Y} {heading.ToString().First()}");
        }
Пример #2
0
        public void SetGetRoverPosition()
        {
            // Arrange
            var expected = new Position {
                X = 0, Y = 0
            };

            _service.SetRoverPosition(_rover, expected);

            // Act
            var actual = _service.GetRoverPosition(_rover);

            // Assert
            Assert.IsTrue(expected.X == actual.X &&
                          expected.X == actual.Y);
        }