当前位置: 首页>>代码示例>>C#>>正文


C# Rover.MoveBackward方法代码示例

本文整理汇总了C#中Rover.MoveBackward方法的典型用法代码示例。如果您正苦于以下问题:C# Rover.MoveBackward方法的具体用法?C# Rover.MoveBackward怎么用?C# Rover.MoveBackward使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rover的用法示例。


在下文中一共展示了Rover.MoveBackward方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestRoverWrapsAroundPlanetBackward

        public void TestRoverWrapsAroundPlanetBackward()
        {
            var rover = new Rover(new Point { X = -50, Y = 0 }, 'E', stateFactory, planet);
            rover.MoveBackward();

            Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("50,0"));
        }
开发者ID:kevPo,项目名称:MarsRover,代码行数:7,代码来源:FacingEastTests.cs

示例2: TestMoveBackward

        public void TestMoveBackward()
        {
            var rover = new Rover(new Point { X = 0, Y = 0 }, 'N', stateFactory, planet);
            rover.MoveBackward();

            Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("0,-1"));
        }
开发者ID:kevPo,项目名称:MarsRover,代码行数:7,代码来源:FacingNorthTests.cs

示例3: TestEnountersObstructionAndDoesNotMoveBackward

        public void TestEnountersObstructionAndDoesNotMoveBackward()
        {
            var planetWithObstruction = new Planet(50, new Point[] { new Point { X = -1, Y = 0 } });
            var rover = new Rover(new Point { X = 0, Y = 0 }, 'E', stateFactory, planetWithObstruction);
            rover.MoveBackward();

            Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("0,0"));
        }
开发者ID:kevPo,项目名称:MarsRover,代码行数:8,代码来源:FacingEastTests.cs

示例4: TestEncounterObstacleOnOtherSideOfAxisAndDoesNotMoveBackward

        public void TestEncounterObstacleOnOtherSideOfAxisAndDoesNotMoveBackward()
        {
            var planetWithObstruction = new Planet(50, new Point[] { new Point { X = 25, Y = 0 } });
            var rover = new Rover(new Point { X = -25, Y = 0 }, 'E', stateFactory, planetWithObstruction);
            rover.MoveBackward();

            Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("-25,0"));
        }
开发者ID:kevPo,项目名称:MarsRover,代码行数:8,代码来源:FacingEastTests.cs

示例5: TestMoveRoverMoveBackwardWest

 public void TestMoveRoverMoveBackwardWest()
 {
     var rover = new Rover(pointAtZeroZero, 'W', stateFactory, planet);
     rover.MoveBackward();
     Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("1,0"));
 }
开发者ID:kevPo,项目名称:MarsRover,代码行数:6,代码来源:RoverTests.cs

示例6: TestRoverWrapsAroundYAxisMovingBackwardSouth

 public void TestRoverWrapsAroundYAxisMovingBackwardSouth()
 {
     var rover = new Rover(new Point { X = 0, Y = 25 }, 'S', stateFactory, planet);
     rover.MoveBackward();
     Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("0,-25"));
 }
开发者ID:kevPo,项目名称:MarsRover,代码行数:6,代码来源:RoverTests.cs

示例7: TestRoverWrapsAroundXAxisMovingBackwardWest

 public void TestRoverWrapsAroundXAxisMovingBackwardWest()
 {
     var rover = new Rover(new Point { X = 25, Y = 0 }, 'W', stateFactory, planet);
     rover.MoveBackward();
     Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("-25,0"));
 }
开发者ID:kevPo,项目名称:MarsRover,代码行数:6,代码来源:RoverTests.cs

示例8: TestMoveRoverMoveBackwardSouth

 public void TestMoveRoverMoveBackwardSouth()
 {
     var rover = new Rover(pointAtZeroZero, 'S', planet);
     rover.MoveBackward();
     Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("0,1"));
 }
开发者ID:kevPo,项目名称:VectorMarsRover,代码行数:6,代码来源:RoverTests.cs


注:本文中的Rover.MoveBackward方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。