本文整理汇总了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"));
}
示例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"));
}
示例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"));
}
示例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"));
}
示例5: TestMoveRoverMoveBackwardWest
public void TestMoveRoverMoveBackwardWest()
{
var rover = new Rover(pointAtZeroZero, 'W', stateFactory, planet);
rover.MoveBackward();
Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("1,0"));
}
示例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"));
}
示例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"));
}
示例8: TestMoveRoverMoveBackwardSouth
public void TestMoveRoverMoveBackwardSouth()
{
var rover = new Rover(pointAtZeroZero, 'S', planet);
rover.MoveBackward();
Assert.That(rover.GetCurrentPosition().ToString(), Is.EqualTo("0,1"));
}