本文整理汇总了C#中Robot.CollectItems方法的典型用法代码示例。如果您正苦于以下问题:C# Robot.CollectItems方法的具体用法?C# Robot.CollectItems怎么用?C# Robot.CollectItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Robot
的用法示例。
在下文中一共展示了Robot.CollectItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RobotDirection_should_be_equal_to_direction
public void RobotDirection_should_be_equal_to_direction([Values("R", "RR", "RRR", "RRRR", "L", "LL", "LLL", "LLLL", "RL", "RLR")]string commands, [Values(Direction.East, Direction.South, Direction.West, Direction.North, Direction.West, Direction.South, Direction.East, Direction.North, Direction.North, Direction.East)] Direction direction)
{
//arrange
Robot robot = new Robot(new TestCommandProvider(commands));
//act
robot.CollectItems(new Map());
//assert
Assert.AreEqual(direction, robot.Direction);
}
示例2: RobotPosition_should__equal_to_x_y
public void RobotPosition_should__equal_to_x_y([Values("F", "B", "FF", "FBFB", "RF", "LF", "RB", "LB", "FRF", "FLF", "LLB")]string commands, [Values(0, 0, 0, 0, 1, -1, -1, 1, 1, -1, 0)]int x, [Values(1, -1, 2, 0, 0, 0, 0, 0, 1, 1, 1)] int y)
{
//arrange
Robot robot = new Robot(new TestCommandProvider(commands));
//act
robot.CollectItems(new Map());
//assert
Assert.AreEqual(x, robot.RobotXCoord);
Assert.AreEqual(y, robot.RobotYCoord);
}