示例#1
0
文件: Tests.cs 项目: Wourly/MarsRover
        public void DestinationCoordinatesSouthWestFromPositionCoordinates()
        {
            // -- arrange
            var rover = new Rover
            {
                Position = new Position {
                    X = 0, Y = 0, Direction = Direction.W
                },
                Destination = new Position {
                    X = -1, Y = -1, Direction = Direction.E
                }
            };

            // -- assert
            rover.DestNorth().ShouldBeEquivalentTo(false);
            rover.DestSouth().ShouldBeEquivalentTo(true);
            rover.DestEast().ShouldBeEquivalentTo(false);
            rover.DestWest().ShouldBeEquivalentTo(true);
        }
示例#2
0
文件: Tests.cs 项目: Wourly/MarsRover
        public void EqualityInCoordsAccordingToDirections()
        {
            // -- arrange
            var rover = new Rover
            {
                Position = new Position {
                    X = 0, Y = 0, Direction = Direction.N
                },
                Destination = new Position {
                    X = 0, Y = 0, Direction = Direction.N
                }
            };

            // -- assert
            rover.DestNorth().ShouldBeEquivalentTo(false);
            rover.DestSouth().ShouldBeEquivalentTo(false);
            rover.DestEast().ShouldBeEquivalentTo(false);
            rover.DestWest().ShouldBeEquivalentTo(false);
        }