public void Test_Reassign_Terminated()
        {
            Procedure             procedure     = new Procedure();
            ConcreteProcedureStep procedureStep = new ConcreteProcedureStep(procedure);
            Staff performer = new Staff();

            procedureStep.Discontinue();

            ConcreteProcedureStep newStep = (ConcreteProcedureStep)procedureStep.Reassign(performer);
        }
        public void Test_Reassign_Scheduled()
        {
            Procedure             procedure     = new Procedure();
            ConcreteProcedureStep procedureStep = new ConcreteProcedureStep(procedure);
            Staff performer = new Staff();

            Assert.IsNotNull(procedureStep.Scheduling);
            Assert.IsNull(procedureStep.Scheduling.Performer);

            ConcreteProcedureStep newStep = (ConcreteProcedureStep)procedureStep.Reassign(performer); // Perform event

            // Make assertions
            Assert.IsNotNull(newStep.Scheduling);
            Assert.IsNotNull(newStep.Scheduling.Performer);
            Assert.IsInstanceOf(typeof(ProcedureStepPerformer), newStep.Scheduling.Performer);
            Assert.AreEqual(performer, ((ProcedureStepPerformer)newStep.Scheduling.Performer).Staff);
        }
        public void Test_Reassign_InProgressOrSuspended()
        {
            DateTime?             now           = DateTime.Now;
            DateTime?             end           = now + TimeSpan.FromDays(3);
            Procedure             procedure     = new Procedure();
            ConcreteProcedureStep procedureStep = new ConcreteProcedureStep(procedure);
            Staff performer = new Staff();

            procedureStep.Schedule(now, end);
            procedureStep.Suspend();
            Assert.AreEqual(ActivityStatus.SU, procedureStep.State);

            ConcreteProcedureStep newStep = (ConcreteProcedureStep)procedureStep.Reassign(performer); // Perform event

            // Make assertions
            Assert.AreEqual(ActivityStatus.DC, procedureStep.State);
            Assert.AreEqual(ActivityStatus.SC, newStep.State);
            Assert.AreEqual(now, newStep.Scheduling.StartTime);
            Assert.AreEqual(end, newStep.Scheduling.EndTime);
            Assert.IsNotNull(newStep.Scheduling);
            Assert.IsNotNull(newStep.Scheduling.Performer);
            Assert.IsInstanceOf(typeof(ProcedureStepPerformer), newStep.Scheduling.Performer);
            Assert.AreEqual(performer, ((ProcedureStepPerformer)newStep.Scheduling.Performer).Staff);
        }
        public void Test_Reassign_Terminated()
        {
            Procedure procedure = new Procedure();
            ConcreteProcedureStep procedureStep = new ConcreteProcedureStep(procedure);
            Staff performer = new Staff();
            procedureStep.Discontinue();

            ConcreteProcedureStep newStep = (ConcreteProcedureStep)procedureStep.Reassign(performer);
		}
        public void Test_Reassign_InProgressOrSuspended()
        {
            DateTime? now = DateTime.Now;
            DateTime? end = now + TimeSpan.FromDays(3);
            Procedure procedure = new Procedure();
            ConcreteProcedureStep procedureStep = new ConcreteProcedureStep(procedure);
            Staff performer = new Staff();
            procedureStep.Schedule(now, end);
            procedureStep.Suspend();
            Assert.AreEqual(ActivityStatus.SU, procedureStep.State);

            ConcreteProcedureStep newStep = (ConcreteProcedureStep)procedureStep.Reassign(performer); // Perform event

            // Make assertions
            Assert.AreEqual(ActivityStatus.DC, procedureStep.State);
            Assert.AreEqual(ActivityStatus.SC, newStep.State);
            Assert.AreEqual(now, newStep.Scheduling.StartTime);
            Assert.AreEqual(end, newStep.Scheduling.EndTime);
            Assert.IsNotNull(newStep.Scheduling);
            Assert.IsNotNull(newStep.Scheduling.Performer);
            Assert.IsInstanceOfType(typeof(ProcedureStepPerformer), newStep.Scheduling.Performer);
            Assert.AreEqual(performer, ((ProcedureStepPerformer)newStep.Scheduling.Performer).Staff);
        }
        public void Test_Reassign_Scheduled()
        {
            Procedure procedure = new Procedure();
            ConcreteProcedureStep procedureStep = new ConcreteProcedureStep(procedure);
            Staff performer = new Staff();

            Assert.IsNotNull(procedureStep.Scheduling);
            Assert.IsNull(procedureStep.Scheduling.Performer);

            ConcreteProcedureStep newStep = (ConcreteProcedureStep)procedureStep.Reassign(performer); // Perform event

            // Make assertions
            Assert.IsNotNull(newStep.Scheduling);
            Assert.IsNotNull(newStep.Scheduling.Performer);
            Assert.IsInstanceOfType(typeof(ProcedureStepPerformer), newStep.Scheduling.Performer);
            Assert.AreEqual(performer, ((ProcedureStepPerformer)newStep.Scheduling.Performer).Staff);
        }