本文整理汇总了C#中Robot.PrintReport方法的典型用法代码示例。如果您正苦于以下问题:C# Robot.PrintReport方法的具体用法?C# Robot.PrintReport怎么用?C# Robot.PrintReport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Robot
的用法示例。
在下文中一共展示了Robot.PrintReport方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunRobot_EmptyCommandSetNullReporter_ZeroPlaceReportGenerated
public void RunRobot_EmptyCommandSetNullReporter_ZeroPlaceReportGenerated()
{
//arrange
CommandFactory commandFactory = new CommandFactory();
commandFactory.AddInput("0");
commandFactory.AddInput("0 0");
CommandSet commandSet = commandFactory.GetCommandSet();
Robot robot = new Robot(commandSet, null);
//act
robot.ExecuteCommands();
string report = robot.PrintReport();
//assert
Assert.AreEqual("=> Cleaned: unknown", report);
}
示例2: Main
static void Main(string[] args)
{
//collect a set of inputs from standard in
CommandFactory commandFactory = new CommandFactory();
while (!commandFactory.InputsAreComplete)
{
Console.WriteLine(">");
commandFactory.AddInput(Console.ReadLine());
}
Console.WriteLine("Input complete. Press any key to continue..");
Console.ReadLine();
//robot should execute cleaning commands
SimpleReporter reporter = new SimpleReporter();
Robot robbie = new Robot(commandFactory.GetCommandSet(), reporter, new Location(0,0), new Location(7,7));
robbie.ExecuteCommands();
//give output on the number of places cleaned
Console.WriteLine(robbie.PrintReport());
}
示例3: RunRobot_BoxMoveCommandSet_NumberofLocationsIsCorrect
public void RunRobot_BoxMoveCommandSet_NumberofLocationsIsCorrect()
{
//arrange
CommandFactory commandFactory = new CommandFactory();
commandFactory.AddInput("4");
commandFactory.AddInput("0 0");
commandFactory.AddInput("N 7");
commandFactory.AddInput("E 7");
commandFactory.AddInput("S 7");
commandFactory.AddInput("W 7");
CommandSet commandSet = commandFactory.GetCommandSet();
IReport reporter = new SimpleReporter();
Robot robot = new Robot(commandSet, reporter, new Location(0, 0), new Location(7, 7));
//act
robot.ExecuteCommands();
string report = robot.PrintReport();
//assert
Assert.AreEqual("=> Cleaned: 28", report);
}
示例4: RunRobot_SimplestCommandSetOneMove_RobotReports1LocationCleaned
public void RunRobot_SimplestCommandSetOneMove_RobotReports1LocationCleaned()
{
//arrange
CommandFactory commandFactory = new CommandFactory();
commandFactory.AddInput("1");
commandFactory.AddInput("10 10");
commandFactory.AddInput("N 1");
CommandSet commandSet = commandFactory.GetCommandSet();
IReport reporter = new SimpleReporter();
Robot robot = new Robot(commandSet, reporter, new Location(-100000, -100000), new Location(100000, 100000));
robot.ExecuteCommands();
//act
string report = robot.PrintReport();
//assert
Assert.AreEqual("=> Cleaned: 1", report);
}