本文整理汇总了C#中JobStatus.ToDTO方法的典型用法代码示例。如果您正苦于以下问题:C# JobStatus.ToDTO方法的具体用法?C# JobStatus.ToDTO怎么用?C# JobStatus.ToDTO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JobStatus
的用法示例。
在下文中一共展示了JobStatus.ToDTO方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: to_status_with_attribute_on_job_type
public void to_status_with_attribute_on_job_type()
{
var status = new JobStatus(typeof(DecoratedJob), DateTime.Today)
{
Status = JobExecutionStatus.Executing,
NextTime = DateTime.Today.AddHours(1),
LastExecution = new JobExecutionRecord
{
Duration = 123,
ExceptionText = null,
Finished = DateTime.Today.AddHours(-1),
Success = true
}
};
var dto = status.ToDTO("foo");
dto.NodeName.ShouldEqual("foo");
dto.JobKey.ShouldEqual("Special");
dto.LastExecution.ShouldEqual(status.LastExecution);
dto.NextTime.ShouldEqual(status.NextTime);
dto.Status.ShouldEqual(JobExecutionStatus.Executing);
}
示例2: to_status_without_any_attribute
public void to_status_without_any_attribute()
{
var status = new JobStatus(typeof (AJob), DateTime.Today)
{
NextTime = DateTime.Today.AddHours(1),
Status = JobExecutionStatus.Scheduled,
LastExecution = new JobExecutionRecord
{
Duration = 123,
ExceptionText = null,
Finished = DateTime.Today.AddHours(-1),
Success = true,
}
};
var dto = status.ToDTO("foo");
dto.NodeName.ShouldEqual("foo");
dto.JobKey.ShouldEqual("AJob");
dto.LastExecution.ShouldEqual(status.LastExecution);
dto.NextTime.ShouldEqual(status.NextTime);
dto.Status.ShouldEqual(JobExecutionStatus.Scheduled);
}