本文整理汇总了C#中Robot.Pick方法的典型用法代码示例。如果您正苦于以下问题:C# Robot.Pick方法的具体用法?C# Robot.Pick怎么用?C# Robot.Pick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Robot
的用法示例。
在下文中一共展示了Robot.Pick方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestReport
public void TestReport()
{
ArrayList line = new ArrayList();
line.Add(new Machine("mixer", "left"));
Machine extruder = new Machine("extruder", "center");
extruder.Put("paste");
line.Add(extruder);
Machine oven = new Machine("oven", "right");
oven.Put("chips");
line.Add(oven);
Robot robot = new Robot();
robot.MoveTo(extruder);
robot.Pick();
StringWriter writer = new StringWriter();
RobotReport.Report(writer, line, robot);
String expected =
"FACTORY REPORT\n" +
"Machine mixer\nMachine extruder\n" +
"Machine oven bin=chips\n\n" +
"Robot location=extruder bin=paste\n" +
"========\n";
Assert.That(writer.ToString(), Is.EqualTo(expected));
}
示例2: testReport
public void testReport()
{
IList<Machine> line = new List<Machine>();
line.Add(new Machine("mixer", "left"));
Machine extruder = new Machine("extruder", "center");
extruder.Put("paste");
line.Add(extruder);
Machine oven = new Machine("oven", "right");
oven.Put("chips");
line.Add(oven);
Robot robot = new Robot();
robot.MoveTo(extruder);
robot.Pick();
StringWriter output = new StringWriter();
HtmlReport.report(output, line, robot);
string expected = "<h1>FACTORY REPORT</h1>\n"
+ "<h2>mixer</h2>\n"
+ "<ul>\n"
+ "<li>location = left</li>\n"
+ "<li>no bin</li>\n"
+ "</ul>\n"
+ "<h2>extruder</h2>\n"
+ "<ul>\n"
+ "<li>location = center</li>\n"
+ "<li>no bin</li>\n"
+ "</ul>\n"
+ "<h2>oven</h2>\n"
+ "<ul>\n"
+ "<li>location = right</li>\n"
+ "<li>bin containing chips</li>\n"
+ "</ul>\n"
+ "<h2>Robot</h2>\n"
+ "<ul>\n"
+ "<li>location = extruder</li>\n"
+ "<li>bin containing paste</li>\n"
+ "</ul>\n";
Assert.That(expected, Is.EqualTo(output.ToString()));
}
示例3: TestRobot
public void TestRobot()
{
Machine sorter = new Machine("Sorter", "left");
sorter.Put("chips");
Machine oven = new Machine("Oven", "middle");
Robot robot = new Robot();
Assert.That("chips", Is.EqualTo(sorter.Bin));
Assert.IsNull(oven.Bin);
Assert.IsNull(robot.Location);
Assert.IsNull(robot.Bin);
robot.MoveTo(sorter);
robot.Pick();
robot.MoveTo(oven);
robot.Release();
Assert.IsNull(robot.Bin);
Assert.That(oven, Is.EqualTo(robot.Location));
Assert.IsNull(sorter.Bin);
Assert.That("chips", Is.EqualTo(oven.Bin));
}