Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }