本文整理汇总了C#中TestTask类的典型用法代码示例。如果您正苦于以下问题:C# TestTask类的具体用法?C# TestTask怎么用?C# TestTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestTask类属于命名空间,在下文中一共展示了TestTask类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RetrieveDescriptionOrNameRetrievesTheNameWhenDescriptionIsNotSet
public void RetrieveDescriptionOrNameRetrievesTheNameWhenDescriptionIsNotSet()
{
var task = new TestTask();
task.Description = null;
var actual = task.RetrieveDescriptionOrName();
Assert.AreEqual(task.GetType().Name, actual);
}
开发者ID:RubenWillems,项目名称:CruiseControl.NET,代码行数:7,代码来源:TaskBaseTests.cs
示例2: SetUp
public void SetUp()
{
_library = new GenericBTLibrary();
_tree = new TestTask(null, "tree1", new ModelTask[0]);
_tree2 = new TestTask(null, "tree2", new ModelTask[0]);
}
开发者ID:BraveSirAndrew,项目名称:DisciplineOak,代码行数:7,代码来源:GenericBTLibraryTests.cs
示例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);
}
开发者ID:modulexcite,项目名称:King.Service,代码行数:7,代码来源:RunAtTaskTests.cs
示例4: RetrieveDescriptionOrNameRetrievesTheDescriptionWhenDescriptionIsSet
public void RetrieveDescriptionOrNameRetrievesTheDescriptionWhenDescriptionIsSet()
{
var task = new TestTask();
task.Description = "Test Task";
var actual = task.RetrieveDescriptionOrName();
Assert.AreEqual(task.Description, actual);
}
开发者ID:RubenWillems,项目名称:CruiseControl.NET,代码行数:7,代码来源:TaskBaseTests.cs
示例5: ValidateHandlesNull
public void ValidateHandlesNull()
{
var task = new TestTask
{
Tasks = null
};
task.Validate(null, null, null);
}
开发者ID:robrich,项目名称:CruiseControl.NET,代码行数:8,代码来源:TaskContainerBaseTests.cs
示例6: ValidateHandlesEmpty
public void ValidateHandlesEmpty()
{
var task = new TestTask
{
Tasks = new ITask[0]
};
task.Validate(null, null, null);
}
开发者ID:robrich,项目名称:CruiseControl.NET,代码行数:8,代码来源:TaskContainerBaseTests.cs
示例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);
}
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:10,代码来源:TaskBaseTests.cs
示例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);
}
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:12,代码来源:SendTestTaskResultCommand.cs
示例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());
}
开发者ID:Qorpent,项目名称:qorpent.sys,代码行数:13,代码来源:TaskInternalsTest.cs
示例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);
}
开发者ID:robrich,项目名称:CruiseControl.NET,代码行数:14,代码来源:TaskContainerBaseTests.cs
示例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);
}
开发者ID:RubenWillems,项目名称:CruiseControl.NET,代码行数:15,代码来源:TaskBaseTests.cs
示例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();
}
开发者ID:robrich,项目名称:CruiseControl.NET,代码行数:15,代码来源:TaskContainerBaseTests.cs
示例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();
}
开发者ID:danaxa,项目名称:Pencil,代码行数:16,代码来源:ExecTaskBaseTests.cs
示例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);
}
开发者ID:apetrovskiy,项目名称:STUPS,代码行数:17,代码来源:SendTestTaskResultCommand.cs
示例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);
}
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:18,代码来源:TaskBaseTests.cs
示例16: ApplyParametersHandlesParameter
public void ApplyParametersHandlesParameter()
{
var dynamicValue = mocks.StrictMock<IDynamicValue>();
var task = new TestTask
{
DynamicValues = new IDynamicValue[]
{
dynamicValue
}
};
var parameters = new Dictionary<string, string>();
var definitions = new List<ParameterBase>();
Expect.Call(() =>
{
dynamicValue.ApplyTo(task, parameters, definitions);
});
mocks.ReplayAll();
task.ApplyParameters(parameters, definitions);
mocks.VerifyAll();
}
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:21,代码来源:TaskBaseTests.cs
示例17: InitialiseStatusHandlesStatusTask
public void InitialiseStatusHandlesStatusTask()
{
var subTask = new MockTask();
var task = new TestTask
{
Tasks = new ITask[]
{
subTask
}
};
task.TestStatus();
Assert.IsNotNull(task.CurrentStatus);
Assert.IsTrue(subTask.SnapshotGenerated);
}
开发者ID:robrich,项目名称:CruiseControl.NET,代码行数:16,代码来源:TaskContainerBaseTests.cs
示例18: RunWrongMinute
public void RunWrongMinute()
{
var now = DateTime.UtcNow;
var minute = now.Minute > 1 ? now.Minute - 1 : 2;
var tt = new TestTask((byte)now.Hour, (sbyte)minute);
tt.Run();
Assert.IsFalse(tt.Called);
}
开发者ID:modulexcite,项目名称:King.Service,代码行数:8,代码来源:RunAtTaskTests.cs
示例19: RunWrongHour
public void RunWrongHour()
{
var now = DateTime.UtcNow;
var hour = now.Hour > 1 ? now.Hour - 1 : 2;
var tt = new TestTask((byte)hour);
tt.Run();
Assert.IsFalse(tt.Called);
}
开发者ID:modulexcite,项目名称:King.Service,代码行数:8,代码来源:RunAtTaskTests.cs
示例20: MinuteMin
public void MinuteMin()
{
var tt = new TestTask(1, sbyte.MinValue);
Assert.AreEqual(-1, tt.Minute);
}
开发者ID:modulexcite,项目名称:King.Service,代码行数:5,代码来源:RunAtTaskTests.cs
注:本文中的TestTask类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论