本文整理汇总了C#中TestTask类的典型用法代码示例。如果您正苦于以下问题:C# TestTask类的具体用法?C# TestTask怎么用?C# TestTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestTask类属于命名空间,在下文中一共展示了TestTask类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RetrieveDescriptionOrNameRetrievesTheNameWhenDescriptionIsNotSet
public void RetrieveDescriptionOrNameRetrievesTheNameWhenDescriptionIsNotSet()
{
var task = new TestTask();
task.Description = null;
var actual = task.RetrieveDescriptionOrName();
Assert.AreEqual(task.GetType().Name, actual);
}
示例2: SetUp
public void SetUp()
{
_library = new GenericBTLibrary();
_tree = new TestTask(null, "tree1", new ModelTask[0]);
_tree2 = new TestTask(null, "tree2", new ModelTask[0]);
}
示例3: RunMinute
public void RunMinute()
{
var now = DateTime.UtcNow;
var tt = new TestTask((byte)now.Hour, (sbyte)now.Minute);
tt.Run();
Assert.IsTrue(tt.Called);
}
示例4: RetrieveDescriptionOrNameRetrievesTheDescriptionWhenDescriptionIsSet
public void RetrieveDescriptionOrNameRetrievesTheDescriptionWhenDescriptionIsSet()
{
var task = new TestTask();
task.Description = "Test Task";
var actual = task.RetrieveDescriptionOrName();
Assert.AreEqual(task.Description, actual);
}
示例5: ValidateHandlesNull
public void ValidateHandlesNull()
{
var task = new TestTask
{
Tasks = null
};
task.Validate(null, null, null);
}
示例6: ValidateHandlesEmpty
public void ValidateHandlesEmpty()
{
var task = new TestTask
{
Tasks = new ITask[0]
};
task.Validate(null, null, null);
}
示例7: ApplyParametersHandlesNull
public void ApplyParametersHandlesNull()
{
var task = new TestTask
{
DynamicValues = null
};
var parameters = new Dictionary<string, string>();
var definitions = new List<ParameterBase>();
task.ApplyParameters(parameters, definitions);
}
示例8: Execute
internal override void Execute()
{
var cmdlet = (SendTmxTestTaskResultCommand)Cmdlet;
var taskUpdater = new TaskUpdater(new RestRequestCreator());
// 20140926
// var testTask = new TestTask { TaskResult = new Dictionary<string, string>() };
var testTask = new TestTask();
foreach (var key in cmdlet.Result.Keys) {
testTask.TaskResult.Add(key.ToString(), cmdlet.Result[key].ToString());
}
taskUpdater.SendTaskResult(testTask, ClientSettings.Instance.ClientId);
}
示例9: 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());
}
示例10: ValidateHandlesValidationTasks
public void ValidateHandlesValidationTasks()
{
var subTask = new MockTask();
var task = new TestTask
{
Tasks = new ITask[]
{
subTask
}
};
task.Validate(null, ConfigurationTrace.Start(null), null);
Assert.IsTrue(subTask.IsValided);
}
示例11: RunWithFalseResultMarksStatusAsFailed
public void RunWithFalseResultMarksStatusAsFailed()
{
var task = new TestTask
{
Result = () => false
};
var result = mocks.DynamicMock<IIntegrationResult>();
mocks.ReplayAll();
task.Run(result);
mocks.VerifyAll();
Assert.IsTrue(task.Executed);
Assert.AreEqual(ItemBuildStatus.CompletedFailed, task.CurrentStatus.Status);
}
示例12: ValidateHandlesNonValidationTasks
public void ValidateHandlesNonValidationTasks()
{
var subTask = mocks.StrictMock<ITask>();
var task = new TestTask
{
Tasks = new ITask[]
{
subTask
}
};
mocks.ReplayAll();
task.Validate(null, null, null);
mocks.VerifyAll();
}
示例13: 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();
}
示例14: Execute
internal override void Execute()
{
var cmdlet = (SendTmxTestTaskResultCommand)Cmdlet;
// 20150918
// var taskUpdater = new TaskUpdater(new RestRequestCreator());
// var taskUpdater = new TaskUpdater();
var taskUpdater = ProxyFactory.Get<TaskUpdater>();
// 20140926
// var testTask = new TestTask { TaskResult = new Dictionary<string, string>() };
// 20150904
var testTask = new TestTask();
// TODO: parameterize this
// var testTask = new TestTask(TestTaskRuntimeTypes.Powershell);
foreach (var key in cmdlet.Result.Keys)
testTask.TaskResult.Add(key.ToString(), cmdlet.Result[key].ToString());
taskUpdater.SendTaskResult(testTask, ClientSettings.Instance.ClientId);
}
示例15: PreprocessParametersAddsDirectValueForValidAttributeDynamicValue
public void PreprocessParametersAddsDirectValueForValidAttributeDynamicValue()
{
var document = new XmlDocument();
var xml = "<item attrib=\"$[value|default]\"><subItem>Text</subItem></item>";
document.LoadXml(xml);
var task = new TestTask();
var actual = task.PreprocessParameters(new NetReflectorTypeTable(), document.DocumentElement);
var expected = "<item attrib=\"default\"><subItem>Text</subItem>" +
"<dynamicValues>" +
"<directValue>" +
"<parameter>value</parameter>" +
"<default>default</default>" +
"<property>attrib</property>" +
"</directValue>" +
"</dynamicValues></item>";
Assert.AreEqual(expected, actual.OuterXml);
}