コード例 #1
0
ファイル: RoverTests.cs プロジェクト: snes20/Rover
        public void RotateRoverFromWest_InvalidRotationPoint()
        {
            var mock = new Moq.Mock <IRoverPosition>();

            mock.SetupProperty(m => m.RoverFacingPosition, RoverFacing.West);
            Rover.ExecuteCommand("R", mock.Object);
            Rover.ExecuteCommand("R", mock.Object);
            Rover.ExecuteCommand("R", mock.Object);
            Rover.ExecuteCommand("R", mock.Object);
            Assert.AreNotEqual <int>((int)mock.Object.RoverFacingPosition, (int)RoverFacing.North);
        }
コード例 #2
0
ファイル: RoverTests.cs プロジェクト: snes20/Rover
        public void MoveRoverOutOfGtrid_North()
        {
            var mock = new Moq.Mock <IRoverPosition>();

            mock.SetupProperty(m => m.RoverFacingPosition, RoverFacing.North);
            mock.SetupProperty(m => m.RoverPositionX, 0);
            mock.SetupProperty(m => m.RoverPositionY, 0);
            Rover.ExecuteCommand("F", mock.Object);
            Assert.AreEqual <int>(mock.Object.RoverPositionX, 0);
            Assert.AreEqual <int>(mock.Object.RoverPositionY, 0);
        }
コード例 #3
0
ファイル: RoverTests.cs プロジェクト: snes20/Rover
        public void RotateRoverRightFromNorthToNorth()
        {
            var mock = new Moq.Mock <IRoverPosition>();

            mock.SetupProperty(m => m.RoverFacingPosition, RoverFacing.North);
            Rover.ExecuteCommand("R", mock.Object);
            Rover.ExecuteCommand("R", mock.Object);
            Rover.ExecuteCommand("R", mock.Object);
            Rover.ExecuteCommand("R", mock.Object);
            Assert.AreEqual <int>((int)mock.Object.RoverFacingPosition, (int)RoverFacing.North);
        }