本文整理汇总了C#中Rover.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Rover.Init方法的具体用法?C# Rover.Init怎么用?C# Rover.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rover
的用法示例。
在下文中一共展示了Rover.Init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init_InitialCoordinatesAndOrientation_RoverOrientationMustBeEqualToInitialOrientation
public void Init_InitialCoordinatesAndOrientation_RoverOrientationMustBeEqualToInitialOrientation()
{
// Arrange
var rover = new Rover();
var initialCoordinates = new Coordinates(0, 0);
var orientation = new NorthOrientation();
var finalOrientation = new NorthOrientation();
// Act
rover.Init(initialCoordinates, orientation);
// Asset
Assert.That(rover.Orientation, Is.EqualTo(finalOrientation));
}
示例2: Move_InitialStateIs00E_FinalStateShouldBe10E
public void Move_InitialStateIs00E_FinalStateShouldBe10E()
{
// Arrange
var rover = new Rover();
var initialCoordinates = new Coordinates(0, 0);
rover.Init(initialCoordinates, new EastOrientation());
// Act
rover.Move();
//Assert
Assert.That(rover.Coordinates, Is.EqualTo(new Coordinates(1, 0)));
}
示例3: TurnRight_InitialOrientationIsWest_FinalOrientationShouldBeNorth
public void TurnRight_InitialOrientationIsWest_FinalOrientationShouldBeNorth()
{
// Arrange
var rover = new Rover();
var initialCoordinates = new Coordinates(0, 0);
rover.Init(initialCoordinates, new WestOrientation());
// Act
rover.TurnRight();
//Assert
Assert.That(rover.Orientation, Is.EqualTo(new NorthOrientation()));
}
示例4: TurnLeft_InitialOrientationIsSouth_FinalOrientationShouldBeEast
public void TurnLeft_InitialOrientationIsSouth_FinalOrientationShouldBeEast()
{
// Arrange
var rover = new Rover();
var initialCoordinates = new Coordinates(0, 0);
rover.Init(initialCoordinates, new SouthOrientation());
// Act
rover.TurnLeft();
//Assert
Assert.That(rover.Orientation, Is.EqualTo(new EastOrientation()));
}
示例5: Move_InitialStateIs55NAndPlateauIsSetTo55_OutOfPlateauException
public void Move_InitialStateIs55NAndPlateauIsSetTo55_OutOfPlateauException()
{
// Arrange
var rover = new Rover();
var initialCoordinates = new Coordinates(5, 5);
rover.Init(initialCoordinates, new NorthOrientation());
var upperLeft = new Coordinates(5, 5);
var plateau = new Plateau(upperLeft);
rover.SetPlateau(plateau);
// Act
rover.Move();
}
示例6: Move_InitialStateIs33WAndPlateauIsSetTo55_TheNewCoordinatesShouldBe23W
public void Move_InitialStateIs33WAndPlateauIsSetTo55_TheNewCoordinatesShouldBe23W()
{
// Arrange
var rover = new Rover();
var initialCoordinates = new Coordinates(3, 3);
rover.Init(initialCoordinates, new WestOrientation());
var upperLeft = new Coordinates(5, 5);
var plateau = new Plateau(upperLeft);
rover.SetPlateau(plateau);
// Act
rover.Move();
// Assert
Assert.That(rover.Coordinates, Is.EqualTo(new Coordinates(2, 3)));
Assert.That(rover.Orientation, Is.EqualTo(new WestOrientation()));
}