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); }
public void Test_RevertCheckIn() { DateTime?now = DateTime.Now; var procedure = new Procedure { ProcedureCheckIn = new ProcedureCheckIn() }; var regStep = new RegistrationProcedureStep(procedure); var staff = TestStaffFactory.CreateStaff(); procedure.CheckIn(staff, now); Assert.IsFalse(procedure.IsPreCheckIn); Assert.IsTrue(procedure.IsCheckedIn); Assert.IsFalse(procedure.IsCheckedOut); Assert.AreEqual(ActivityStatus.IP, regStep.State); Assert.IsNull(regStep.EndTime); procedure.RevertCheckIn(); Assert.IsTrue(procedure.IsPreCheckIn); Assert.IsFalse(procedure.IsCheckedIn); Assert.IsFalse(procedure.IsCheckedOut); Assert.IsNull(procedure.ProcedureCheckIn.CheckInTime); Assert.IsNull(procedure.ProcedureCheckIn.CheckOutTime); // the registration step is not reverted Assert.AreEqual(ActivityStatus.IP, regStep.State); Assert.AreEqual(staff, regStep.PerformingStaff); }
public void Test_Schedule() { var procedure = new Procedure(); var ps = new RegistrationProcedureStep(procedure); var now = DateTime.Now; var later = now + TimeSpan.FromDays(3); Assert.IsNull(ps.Scheduling.StartTime); Assert.AreEqual(ProcedureStatus.SC, procedure.Status); Assert.AreEqual(ActivityStatus.SC, ps.State); procedure.Schedule(now); Assert.AreEqual(now.Truncate(DateTimePrecision.Minute), ps.Scheduling.StartTime); Assert.AreEqual(ProcedureStatus.SC, procedure.Status); Assert.AreEqual(ActivityStatus.SC, ps.State); procedure.Schedule(later); Assert.AreEqual(later.Truncate(DateTimePrecision.Minute), ps.Scheduling.StartTime); Assert.AreEqual(ProcedureStatus.SC, procedure.Status); Assert.AreEqual(ActivityStatus.SC, ps.State); }
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); }
public void Test_Schedule() { var procedure = new Procedure(); var ps = new RegistrationProcedureStep(procedure); var now = DateTime.Now; var later = now + TimeSpan.FromDays(3); Assert.IsNull(ps.Scheduling.StartTime); Assert.AreEqual(ProcedureStatus.SC, procedure.Status); Assert.AreEqual(ActivityStatus.SC, ps.State); procedure.Schedule(now); Assert.AreEqual(now.Truncate(DateTimePrecision.Minute), ps.Scheduling.StartTime); Assert.AreEqual(ProcedureStatus.SC, procedure.Status); Assert.AreEqual(ActivityStatus.SC, ps.State); procedure.Schedule(later); Assert.AreEqual(later.Truncate(DateTimePrecision.Minute), ps.Scheduling.StartTime); Assert.AreEqual(ProcedureStatus.SC, procedure.Status); Assert.AreEqual(ActivityStatus.SC, ps.State); }
public void Test_RevertCheckIn() { DateTime? now = DateTime.Now; var procedure = new Procedure { ProcedureCheckIn = new ProcedureCheckIn() }; var regStep = new RegistrationProcedureStep(procedure); var staff = TestStaffFactory.CreateStaff(); procedure.CheckIn(staff, now); Assert.IsFalse(procedure.IsPreCheckIn); Assert.IsTrue(procedure.IsCheckedIn); Assert.IsFalse(procedure.IsCheckedOut); Assert.AreEqual(ActivityStatus.IP, regStep.State); Assert.IsNull(regStep.EndTime); procedure.RevertCheckIn(); Assert.IsTrue(procedure.IsPreCheckIn); Assert.IsFalse(procedure.IsCheckedIn); Assert.IsFalse(procedure.IsCheckedOut); Assert.IsNull(procedure.ProcedureCheckIn.CheckInTime); Assert.IsNull(procedure.ProcedureCheckIn.CheckOutTime); // the registration step is not reverted Assert.AreEqual(ActivityStatus.IP, regStep.State); Assert.AreEqual(staff, regStep.PerformingStaff); }