本文整理汇总了C#中TestTask.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# TestTask.Execute方法的具体用法?C# TestTask.Execute怎么用?C# TestTask.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestTask
的用法示例。
在下文中一共展示了TestTask.Execute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CascadeError
public void CascadeError() {
var sw = new StringWriter();
var t1 = new TestTask {DoError = true};
var t2 = new TestTask(sw);
t2.RequiredModules.Add(t1);
t1.Execute();
t2.Execute();
Console.WriteLine(sw.ToString());
Assert.AreEqual(@"
S:Pending
S:CascadeError
".Trim(), sw.ToString().Trim());
}
示例2: Execute_should_call_wait_for_exit_before_ExitCode
public void Execute_should_call_wait_for_exit_before_ExitCode()
{
//Since mono is broken and won't give us the ExitCode otherwise.
var process = new ProcessStub();
var waitForExitCalled = false;
process.WaitForExitHandler = () => waitForExitCalled = true;
process.GetExitCodeHandler = () =>
{
Assert.IsTrue(waitForExitCalled);
return 0;
};
var platform = new ExecutionEnvironmentStub();
platform.RunHandler = (program, args, handler) => handler(process);
var task = new TestTask(platform);
task.Execute();
}