本文整理汇总了C#中Procedure.AddProcedureStep方法的典型用法代码示例。如果您正苦于以下问题:C# Procedure.AddProcedureStep方法的具体用法?C# Procedure.AddProcedureStep怎么用?C# Procedure.AddProcedureStep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Procedure
的用法示例。
在下文中一共展示了Procedure.AddProcedureStep方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_GetRelatedProcedureSteps
public void Test_GetRelatedProcedureSteps()
{
Procedure procedure = new Procedure();
Report report = new Report(procedure);
ReportPart reportPart = new ReportPart(report, 1);
// Testing that procedure steps with tied report will be related steps
ConcreteReportingProcedureStep p1 = new ConcreteReportingProcedureStep(procedure, reportPart);
ConcreteReportingProcedureStep p2 = new ConcreteReportingProcedureStep(procedure, reportPart);
// expect that each ps is tied by common report
Assert.AreEqual(report, p1.Report);
Assert.AreEqual(report, p2.Report);
Assert.Contains(p2, p1.GetRelatedProcedureSteps());
Assert.Contains(p1, p2.GetRelatedProcedureSteps());
// testing that proedure steps with null report will have no relatives
p1 = new ConcreteReportingProcedureStep(procedure, null);
p2 = new ConcreteReportingProcedureStep(procedure, null);
// expect the each ps has no relatives
Assert.IsEmpty(p1.GetRelatedProcedureSteps());
Assert.IsEmpty(p2.GetRelatedProcedureSteps());
// Testing that the relative has to be a report step
GenericProtocolProcedureStep p3 = new GenericProtocolProcedureStep(new Protocol(procedure));
procedure.AddProcedureStep(p3);
// expect that the related psteps are not related to the different step
Assert.IsFalse(p3.GetRelatedProcedureSteps().Contains(p1));
Assert.IsFalse(p3.GetRelatedProcedureSteps().Contains(p2));
Assert.IsFalse(p1.GetRelatedProcedureSteps().Contains(p3));
Assert.IsFalse(p2.GetRelatedProcedureSteps().Contains(p3));
}
示例2: Test_GetRelatedProcedureSteps
public void Test_GetRelatedProcedureSteps()
{
Procedure procedure = new Procedure();
// Testing that procedure steps with tied protocols will be related steps
Protocol protocol = new Protocol(procedure);
ConcreteProtocolProcedureStep ps1 = new ConcreteProtocolProcedureStep(protocol);
procedure.AddProcedureStep(ps1);
ConcreteProtocolProcedureStep ps2 = new ConcreteProtocolProcedureStep(protocol);
procedure.AddProcedureStep(ps2);
// expect that each ps is tied by common protocol
Assert.AreEqual(protocol, ps1.Protocol);
Assert.AreEqual(protocol, ps2.Protocol);
Assert.Contains(ps2, ps1.GetRelatedProcedureSteps());
Assert.Contains(ps1, ps2.GetRelatedProcedureSteps());
// Testing that the relative has to be a protocol step
GenericReportingProcedureStep ps3 = new GenericReportingProcedureStep(procedure);
Assert.IsTrue(procedure.ProcedureSteps.Contains(ps3));
// expect that the related psteps are not related to the different step
Assert.IsFalse(ps3.GetRelatedProcedureSteps().Contains(ps1));
Assert.IsFalse(ps3.GetRelatedProcedureSteps().Contains(ps2));
Assert.IsFalse(ps1.GetRelatedProcedureSteps().Contains(ps3));
Assert.IsFalse(ps2.GetRelatedProcedureSteps().Contains(ps3));
}
示例3: AddProcedureSteps
private static void AddProcedureSteps(Procedure procedure, int numMps)
{
Modality m = new Modality("01", "CT", procedure.PerformingFacility, null, null);
for (int s = 0; s < numMps; s++)
{
ModalityProcedureStep step = new ModalityProcedureStep();
step.Description = "MPS 10" + s;
step.Modality = m;
procedure.AddProcedureStep(step);
}
}
示例4: Test_Schedule_PreStep_And_SchedulingOffset
public void Test_Schedule_PreStep_And_SchedulingOffset()
{
var procedure = new Procedure(new ProcedureType(), "111", "1.111");
var protocolStep = new ProtocolAssignmentStep(new Protocol(procedure));
procedure.AddProcedureStep(protocolStep);
var registrationStep = new RegistrationProcedureStep(procedure);
var modalityStep = new ModalityProcedureStep(procedure, "description", new Modality());
var documentationStep = new DocumentationProcedureStep(procedure);
var reportingStep = new ConcreteReportingProcedureStep(procedure);
Assert.IsNull(protocolStep.Scheduling.StartTime);
Assert.IsNull(registrationStep.Scheduling.StartTime);
Assert.IsNull(modalityStep.Scheduling.StartTime);
Assert.IsNull(documentationStep.Scheduling.StartTime);
Assert.IsNull(reportingStep.Scheduling.StartTime);
var now = DateTime.Now;
procedure.Schedule(now);
Assert.AreEqual(now.Truncate(DateTimePrecision.Minute), procedure.ScheduledStartTime);
Assert.AreEqual(protocolStep.CreationTime, protocolStep.Scheduling.StartTime);
Assert.AreEqual(procedure.ScheduledStartTime, registrationStep.Scheduling.StartTime);
Assert.AreEqual(procedure.ScheduledStartTime, modalityStep.Scheduling.StartTime);
Assert.IsNull(documentationStep.Scheduling.StartTime);
Assert.IsNull(reportingStep.Scheduling.StartTime);
}
示例5: Test_AddProcedureStep_StepNotScheduling
public void Test_AddProcedureStep_StepNotScheduling()
{
var procedure = new Procedure();
var procedureStep = new ModalityProcedureStep(procedure, "New Modality", new Modality());
procedureStep.Start(new Staff());
Assert.AreEqual(ActivityStatus.IP, procedureStep.State);
procedure.AddProcedureStep(procedureStep);
}
示例6: Test_AddProcedureStep_StepProcedureNotNull
public void Test_AddProcedureStep_StepProcedureNotNull()
{
var p1 = new Procedure();
var ps = new DocumentationProcedureStep();
Assert.IsNull(ps.Procedure);
p1.AddProcedureStep(ps);
Assert.AreEqual(p1, ps.Procedure);
var p2 = new Procedure();
p2.AddProcedureStep(ps);
}
示例7: Test_AddProcedureStep
public void Test_AddProcedureStep()
{
var procedure = new Procedure();
var ps = new DocumentationProcedureStep();
Assert.IsFalse(procedure.ProcedureSteps.Contains(ps));
Assert.AreNotEqual(procedure, ps.Procedure);
procedure.AddProcedureStep(ps);
Assert.IsTrue(procedure.ProcedureSteps.Contains(ps));
Assert.AreEqual(procedure, ps.Procedure);
}
示例8: Test_GetProcedureSteps
public void Test_GetProcedureSteps()
{
var procedure = new Procedure();
Assert.IsEmpty(procedure.GetProcedureSteps(delegate { return true; }));
var ps1 = new DocumentationProcedureStep(procedure);
var ps2 = new ModalityProcedureStep(procedure, "1", new Modality());
var ps3 = new ModalityProcedureStep(procedure, "2", new Modality());
var ps4 = new ProtocolAssignmentStep();
procedure.AddProcedureStep(ps4);
Assert.AreEqual(4, procedure.GetProcedureSteps(delegate { return true; }).Count);
Assert.IsEmpty(procedure.GetProcedureSteps(delegate { return false; }));
Assert.AreEqual(1, procedure.GetProcedureSteps(ps => ps is DocumentationProcedureStep).Count);
Assert.AreEqual(2, procedure.GetProcedureSteps(ps => ps is ModalityProcedureStep).Count);
Assert.AreEqual(0, procedure.GetProcedureSteps(ps => ps is ReportingProcedureStep).Count);
Assert.AreEqual(1, procedure.GetProcedureSteps(ps => ps is ProtocolProcedureStep).Count);
}