Exemplo n.º 1
0
        public void Test_Assign_FromNonScheduledState()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Start(new ConcreteActivityPerformer());
            activity.Assign(new ConcreteActivityPerformer());
        }
Exemplo n.º 2
0
        public void Test_Schedule_WithNulls()
        {
            DateTime now = DateTime.Now;
            DateTime later = now + TimeSpan.FromHours(3);

            // Null scheduled activity
            ConcreteActivity activity2 = new ConcreteActivity();
            activity2.Schedule(null, null);
            Assert.IsNull(activity2.Scheduling.StartTime);
            Assert.IsNull(activity2.Scheduling.EndTime);
            Assert.AreEqual(ActivityStatus.SC, activity2.State);

            // Null scheduled activity
            ConcreteActivity activity3 = new ConcreteActivity();
            activity3.Schedule(null);
            Assert.IsNull(activity3.Scheduling.StartTime);
            Assert.IsNull(activity3.Scheduling.EndTime);
            Assert.AreEqual(ActivityStatus.SC, activity3.State);

            ConcreteActivity activity4 = new ConcreteActivity();
            activity4.Schedule(later);
            Assert.AreEqual(later, activity4.Scheduling.StartTime);
            Assert.IsNull(activity4.Scheduling.EndTime);
            Assert.AreEqual(ActivityStatus.SC, activity4.State);

            ConcreteActivity activity5 = new ConcreteActivity();
            activity5.Schedule(null, later);
            Assert.IsNull(activity5.Scheduling.StartTime);
            Assert.AreEqual(later, activity5.Scheduling.EndTime);
            Assert.AreEqual(ActivityStatus.SC, activity5.State);
        }
Exemplo n.º 3
0
        public void Test_Schedule_FromNonScheduledState()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Start(new ConcreteActivityPerformer());
            activity.Schedule(DateTime.Now, DateTime.Now + TimeSpan.FromDays(3));
        }
Exemplo n.º 4
0
        public void Test_IP_to_IP()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Start(new ConcreteActivityPerformer());
            activity.Start(new ConcreteActivityPerformer());
        }
Exemplo n.º 5
0
        public void Test_Schedule_WithNulls()
        {
            DateTime now   = DateTime.Now;
            DateTime later = now + TimeSpan.FromHours(3);

            // Null scheduled activity
            ConcreteActivity activity2 = new ConcreteActivity();

            activity2.Schedule(null, null);
            Assert.IsNull(activity2.Scheduling.StartTime);
            Assert.IsNull(activity2.Scheduling.EndTime);
            Assert.AreEqual(ActivityStatus.SC, activity2.State);

            // Null scheduled activity
            ConcreteActivity activity3 = new ConcreteActivity();

            activity3.Schedule(null);
            Assert.IsNull(activity3.Scheduling.StartTime);
            Assert.IsNull(activity3.Scheduling.EndTime);
            Assert.AreEqual(ActivityStatus.SC, activity3.State);

            ConcreteActivity activity4 = new ConcreteActivity();

            activity4.Schedule(later);
            Assert.AreEqual(later, activity4.Scheduling.StartTime);
            Assert.IsNull(activity4.Scheduling.EndTime);
            Assert.AreEqual(ActivityStatus.SC, activity4.State);

            ConcreteActivity activity5 = new ConcreteActivity();

            activity5.Schedule(null, later);
            Assert.IsNull(activity5.Scheduling.StartTime);
            Assert.AreEqual(later, activity5.Scheduling.EndTime);
            Assert.AreEqual(ActivityStatus.SC, activity5.State);
        }
Exemplo n.º 6
0
        public void Test_SU_to_SU()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Suspend();
            activity.Suspend();
        }
Exemplo n.º 7
0
        public void Test_SC_to_CM()
        {
            ConcreteActivity activity = new ConcreteActivity();

            Assert.AreEqual(ActivityStatus.SC, activity.State);
            activity.Complete(new ConcreteActivityPerformer());
            Assert.AreEqual(ActivityStatus.CM, activity.State);
        }
Exemplo n.º 8
0
        public void Test_SC_to_SU()
        {
            ConcreteActivity activity = new ConcreteActivity();

            Assert.AreEqual(ActivityStatus.SC, activity.State);
            activity.Suspend();
            Assert.AreEqual(ActivityStatus.SU, activity.State);
        }
Exemplo n.º 9
0
        public void Test_CM_to_CM()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Start(new ConcreteActivityPerformer());
            activity.Complete();
            activity.Complete();
        }
Exemplo n.º 10
0
        public void Test_DC_to_DC()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Start(new ConcreteActivityPerformer());
            activity.Discontinue();
            activity.Discontinue();
        }
Exemplo n.º 11
0
        public void Test_SC_to_DC()
        {
            ConcreteActivity activity = new ConcreteActivity();

            Assert.AreEqual(ActivityStatus.SC, activity.State);
            activity.Discontinue();
            Assert.AreEqual(ActivityStatus.DC, activity.State);
        }
Exemplo n.º 12
0
        public void Test_Complete_PerformerExistsAlready()
        {
            ConcreteActivity          activity          = new ConcreteActivity();
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();

            activity.Start(activityPerformer);

            activity.Complete(new ConcreteActivityPerformer(), DateTime.Now); // Perform event
        }
Exemplo n.º 13
0
        public void Test_Suspend()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Suspend(); // Perform event

            Assert.AreEqual(ActivityStatus.SU, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
        }
Exemplo n.º 14
0
		public void Test_ctor()
		{
            ConcreteActivity activity = new ConcreteActivity();
            Assert.AreEqual(ActivityStatus.SC, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.CreationTime));
            Assert.IsNotNull(activity.Scheduling);
            Assert.IsNotNull(activity.PerformedSteps);
            Assert.IsTrue(activity.PerformedSteps.IsEmpty);
        }
Exemplo n.º 15
0
        public void Test_ctor()
        {
            ConcreteActivity activity = new ConcreteActivity();

            Assert.AreEqual(ActivityStatus.SC, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.CreationTime));
            Assert.IsNotNull(activity.Scheduling);
            Assert.IsNotNull(activity.PerformedSteps);
            Assert.IsTrue(activity.PerformedSteps.IsEmpty);
        }
Exemplo n.º 16
0
        public void Test_Assign()
        {
            ConcreteActivity          activity          = new ConcreteActivity();
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();

            activity.Assign(activityPerformer);

            Assert.IsNotNull(activity.Scheduling);
            Assert.AreEqual(activityPerformer, activity.Scheduling.Performer);
            Assert.AreEqual(ActivityStatus.SC, activity.State);
        }
Exemplo n.º 17
0
        public void Test_Schedule()
        {
            DateTime now = DateTime.Now;

            // Properly scheduled activity
            ConcreteActivity activity = new ConcreteActivity();
            activity.Schedule(now, now + TimeSpan.FromDays(3));
            // Assertion: scheduling proprety is set properly
            Assert.IsNotNull(activity.Scheduling);
            Assert.AreEqual(now, activity.Scheduling.StartTime);
            Assert.AreEqual(now + TimeSpan.FromDays(3), activity.Scheduling.EndTime);
        }
Exemplo n.º 18
0
        public void Test_Schedule()
        {
            DateTime now = DateTime.Now;

            // Properly scheduled activity
            ConcreteActivity activity = new ConcreteActivity();

            activity.Schedule(now, now + TimeSpan.FromDays(3));
            // Assertion: scheduling proprety is set properly
            Assert.IsNotNull(activity.Scheduling);
            Assert.AreEqual(now, activity.Scheduling.StartTime);
            Assert.AreEqual(now + TimeSpan.FromDays(3), activity.Scheduling.EndTime);
        }
Exemplo n.º 19
0
        public void Test_Complete_NullArgs()
        {
            ConcreteActivity          activity          = new ConcreteActivity();
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();

            activity.Start(activityPerformer);

            activity.Complete(); // Perform event

            // Make assertions
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.EndTime));
            Assert.AreEqual(ActivityStatus.CM, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
        }
Exemplo n.º 20
0
        public void Test_Start()
        {
            DateTime?                 now               = DateTime.Now;
            ConcreteActivity          activity          = new ConcreteActivity();
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();

            activity.Start(activityPerformer, now); // Perform event

            // Make assertions
            Assert.AreEqual(activityPerformer, activity.Performer);
            Assert.AreEqual(now, activity.StartTime);
            Assert.AreEqual(ActivityStatus.IP, activity.State);
            Assert.AreEqual(now, activity.LastStateChangeTime);
        }
Exemplo n.º 21
0
        public void Test_Start_NullTime()
        {
            DateTime?                 now               = DateTime.Now;
            ConcreteActivity          activity          = new ConcreteActivity();
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();

            activity.Start(activityPerformer); // Perform event

            // Make assertions
            Assert.AreEqual(activityPerformer, activity.Performer);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.StartTime));
            Assert.AreEqual(ActivityStatus.IP, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
        }
Exemplo n.º 22
0
        public void Test_Complete()
        {
            DateTime?now = DateTime.Now;
            DateTime?end = now + TimeSpan.FromDays(3);
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();
            ConcreteActivity          activity          = new ConcreteActivity();

            activity.Complete(activityPerformer, end);// Perform event

            // Make assertions
            Assert.AreEqual(activityPerformer, activity.Performer);
            Assert.AreEqual(activity.StartTime, activity.EndTime);
            Assert.AreEqual(ActivityStatus.CM, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
        }
Exemplo n.º 23
0
        public void Test_AddPerformedStep()
        {
            ConcreteActivity      activity      = new ConcreteActivity();
            ConcretePerformedStep performedStep = new ConcretePerformedStep();

            Assert.IsTrue(activity.PerformedSteps.IsEmpty);
            Assert.IsTrue(performedStep.Activities.IsEmpty);

            activity.AddPerformedStep(performedStep);// Perform event

            // Make assertions
            Assert.IsTrue(activity.PerformedSteps.Contains(performedStep));
            Assert.AreEqual(1, activity.PerformedSteps.Count);
            Assert.IsTrue(performedStep.Activities.Contains(activity));
            Assert.AreEqual(1, performedStep.Activities.Count);
        }
Exemplo n.º 24
0
        public void Test_TimeShift_TimeAndSchedulingNull()
        {
            ConcreteActivity activity = new ConcreteActivity();
            DateTime?        start    = activity.StartTime,
                    end        = activity.EndTime,
                    schedStart = activity.Scheduling.StartTime,
                    schedEnd   = activity.Scheduling.EndTime;

            activity.TimeShift(10);// Perform event

            // Make assertions
            Assert.AreEqual(activity.StartTime, start);
            Assert.AreEqual(activity.EndTime, end);
            Assert.AreEqual(activity.Scheduling.StartTime, schedStart);
            Assert.AreEqual(activity.Scheduling.EndTime, schedEnd);
        }
Exemplo n.º 25
0
        public void Test_RemovePerformedStep_WithoutAdding()
        {
            ConcreteActivity      activity       = new ConcreteActivity();
            ConcretePerformedStep performedStep  = new ConcretePerformedStep();
            ConcretePerformedStep performedStep2 = new ConcretePerformedStep();

            activity.AddPerformedStep(performedStep2);

            Assert.AreEqual(1, activity.PerformedSteps.Count);
            Assert.IsTrue(activity.PerformedSteps.Contains(performedStep2));

            // remove a step that does not exist in the set
            activity.RemovePerformedStep(performedStep);// Perform event

            Assert.AreEqual(1, activity.PerformedSteps.Count);
            Assert.IsTrue(activity.PerformedSteps.Contains(performedStep2));
        }
Exemplo n.º 26
0
        public void Test_Timeshift()
        {
            DateTime?now = DateTime.Now;
            DateTime?end = DateTime.Now + TimeSpan.FromDays(30);
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();
            ConcreteActivity          activity          = new ConcreteActivity();

            activity.Schedule(now, end);
            activity.Start(activityPerformer, now);
            activity.Complete(end);

            activity.TimeShift(10);             // Perform event

            // Make assertions
            Assert.AreEqual(activity.StartTime, now.Value.AddMinutes(10));
            Assert.AreEqual(activity.EndTime, end.Value.AddMinutes(10));
            Assert.AreEqual(activity.Scheduling.StartTime, now.Value.AddMinutes(10));
            Assert.AreEqual(activity.Scheduling.EndTime, end.Value.AddMinutes(10));
        }
Exemplo n.º 27
0
        public void Test_Discontinue_NullTime()
        {
            DateTime?        now      = DateTime.Now;
            ConcreteActivity activity = new ConcreteActivity();

            activity.PerformedSteps.Add(new ConcretePerformedStep());
            activity.PerformedSteps.Add(new ConcretePerformedStep());
            activity.PerformedSteps.Add(new ConcretePerformedStep());

            activity.Discontinue(); // Perform event

            // Make assertions
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.EndTime));
            foreach (PerformedStep step in activity.PerformedSteps)
            {
                Assert.IsTrue(step.IsTerminated);
            }
            Assert.AreEqual(ActivityStatus.DC, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
        }
Exemplo n.º 28
0
 public void Test_CM_to_CM()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Start(new ConcreteActivityPerformer());
     activity.Complete();
     activity.Complete();
 }
Exemplo n.º 29
0
 public void Test_IP_to_IP()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Start(new ConcreteActivityPerformer());
     activity.Start(new ConcreteActivityPerformer());
 }
Exemplo n.º 30
0
        public void Test_Start_NullPerformer()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Start(null); // Perform event
        }
Exemplo n.º 31
0
 public void Test_SC_to_SU()
 {
     ConcreteActivity activity = new ConcreteActivity();
     Assert.AreEqual(ActivityStatus.SC, activity.State);
     activity.Suspend();
     Assert.AreEqual(ActivityStatus.SU, activity.State);
 }
Exemplo n.º 32
0
        public void Test_Timeshift()
        {
			DateTime? now = DateTime.Now;
			DateTime? end = DateTime.Now + TimeSpan.FromDays(30);
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();
			ConcreteActivity activity = new ConcreteActivity();
			activity.Schedule(now, end);
            activity.Start(activityPerformer, now);
            activity.Complete(end);
			
			activity.TimeShift(10); // Perform event
			
            // Make assertions
            Assert.AreEqual(activity.StartTime, now.Value.AddMinutes(10));
			Assert.AreEqual(activity.EndTime, end.Value.AddMinutes(10));
			Assert.AreEqual(activity.Scheduling.StartTime, now.Value.AddMinutes(10));
			Assert.AreEqual(activity.Scheduling.EndTime, end.Value.AddMinutes(10));
        }
Exemplo n.º 33
0
        public void Test_RemovePerformedStep()
        {
            ConcreteActivity activity = new ConcreteActivity();
            ConcretePerformedStep performedStep = new ConcretePerformedStep();
            activity.AddPerformedStep(performedStep);

            Assert.IsTrue(activity.PerformedSteps.Contains(performedStep));
            Assert.AreEqual(1, activity.PerformedSteps.Count);
            Assert.IsTrue(performedStep.Activities.Contains(activity));
            Assert.AreEqual(1, performedStep.Activities.Count);

            activity.RemovePerformedStep(performedStep);// Perform event

            // Make assertions
            Assert.IsTrue(activity.PerformedSteps.IsEmpty);
            Assert.IsTrue(performedStep.Activities.IsEmpty);
        }
Exemplo n.º 34
0
 public void Test_Complete_NoPerformer()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Complete(); // Perform event
 }
Exemplo n.º 35
0
        public void Test_Resume_NonSuspendedState()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Resume(); // Perform event
        }
Exemplo n.º 36
0
        public void Test_Complete_NoPerformer()
        {
            ConcreteActivity activity = new ConcreteActivity();

            activity.Complete(); // Perform event
        }
Exemplo n.º 37
0
        public void Test_Complete_NullEndTime()
        {
            DateTime? now = DateTime.Now;
            DateTime? end = now + TimeSpan.FromDays(3);
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();
            ConcreteActivity activity = new ConcreteActivity();

            activity.Complete(activityPerformer); // Perform event

            // Make assertions
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.EndTime));
            Assert.AreEqual(activityPerformer, activity.Performer);
            Assert.AreEqual(activity.StartTime, activity.EndTime);
            Assert.AreEqual(ActivityStatus.CM, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
        }
Exemplo n.º 38
0
 public void Test_Assign_FromNonScheduledState()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Start(new ConcreteActivityPerformer());
     activity.Assign(new ConcreteActivityPerformer());
 }
Exemplo n.º 39
0
        public void Test_Complete_PerformerExistsAlready()
        {
            ConcreteActivity activity = new ConcreteActivity();
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();
            activity.Start(activityPerformer);

            activity.Complete(new ConcreteActivityPerformer(), DateTime.Now); // Perform event
        }
Exemplo n.º 40
0
        public void Test_Start()
        {
            DateTime? now = DateTime.Now;
            ConcreteActivity activity = new ConcreteActivity();
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();

            activity.Start(activityPerformer, now); // Perform event

            // Make assertions
            Assert.AreEqual(activityPerformer, activity.Performer);
            Assert.AreEqual(now, activity.StartTime);
            Assert.AreEqual(ActivityStatus.IP, activity.State);
            Assert.AreEqual(now, activity.LastStateChangeTime);
        }
Exemplo n.º 41
0
        public void Test_RemovePerformedStep_WithoutAdding()
        {
            ConcreteActivity activity = new ConcreteActivity();
            ConcretePerformedStep performedStep = new ConcretePerformedStep();
            ConcretePerformedStep performedStep2 = new ConcretePerformedStep();

            activity.AddPerformedStep(performedStep2);

            Assert.AreEqual(1, activity.PerformedSteps.Count);
            Assert.IsTrue(activity.PerformedSteps.Contains(performedStep2));

            // remove a step that does not exist in the set
            activity.RemovePerformedStep(performedStep);// Perform event

            Assert.AreEqual(1, activity.PerformedSteps.Count);
            Assert.IsTrue(activity.PerformedSteps.Contains(performedStep2));
        }
Exemplo n.º 42
0
 public void Test_Start_NullTime()
 {
     DateTime? now = DateTime.Now;
     ConcreteActivity activity = new ConcreteActivity();
     ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();
     
     activity.Start(activityPerformer); // Perform event
     
     // Make assertions
     Assert.AreEqual(activityPerformer, activity.Performer);
     Assert.IsTrue(RoughlyEqual(Platform.Time, activity.StartTime));
     Assert.AreEqual(ActivityStatus.IP, activity.State);
     Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
 }
Exemplo n.º 43
0
        public void Test_TimeShift_TimeAndSchedulingNull()
        {
            ConcreteActivity activity = new ConcreteActivity();
            DateTime? start = activity.StartTime,
                      end = activity.EndTime,
                      schedStart = activity.Scheduling.StartTime,
                      schedEnd = activity.Scheduling.EndTime;

            activity.TimeShift(10);// Perform event

            // Make assertions
            Assert.AreEqual(activity.StartTime, start);
            Assert.AreEqual(activity.EndTime, end);
            Assert.AreEqual(activity.Scheduling.StartTime, schedStart);
            Assert.AreEqual(activity.Scheduling.EndTime, schedEnd);
        }
Exemplo n.º 44
0
 public void Test_Start_NullPerformer()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Start(null); // Perform event
 }
Exemplo n.º 45
0
 public void Test_SU_to_CM()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Suspend();
     Assert.AreEqual(ActivityStatus.SU, activity.State);
     activity.Complete(new ConcreteActivityPerformer());
     Assert.AreEqual(ActivityStatus.CM, activity.State);
 }
Exemplo n.º 46
0
 public void Test_Resume()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Suspend();
     
     activity.Resume(); // Perform event
     
     Assert.AreEqual(ActivityStatus.IP, activity.State);
     Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
 }
Exemplo n.º 47
0
 public void Test_SU_to_DC()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Suspend();
     Assert.AreEqual(ActivityStatus.SU, activity.State);
     activity.Discontinue();
     Assert.AreEqual(ActivityStatus.DC, activity.State);
 }
Exemplo n.º 48
0
 public void Test_Resume_NonSuspendedState()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Resume(); // Perform event
 }
Exemplo n.º 49
0
 public void Test_SU_to_SU()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Suspend();
     activity.Suspend();
 }
Exemplo n.º 50
0
        public void Test_Discontinue_NullTime()
        {
            DateTime? now = DateTime.Now;
            ConcreteActivity activity = new ConcreteActivity();
            activity.PerformedSteps.Add(new ConcretePerformedStep());
            activity.PerformedSteps.Add(new ConcretePerformedStep());
            activity.PerformedSteps.Add(new ConcretePerformedStep());

            activity.Discontinue(); // Perform event

            // Make assertions
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.EndTime));
            foreach (PerformedStep step in activity.PerformedSteps)
            {
                Assert.IsTrue(step.IsTerminated);
            }
            Assert.AreEqual(ActivityStatus.DC, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
        }
Exemplo n.º 51
0
 public void Test_DC_to_DC()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Start(new ConcreteActivityPerformer());
     activity.Discontinue();
     activity.Discontinue();
 }
Exemplo n.º 52
0
        public void Test_Complete_NullArgs()
        {
            ConcreteActivity activity = new ConcreteActivity();
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();
            activity.Start(activityPerformer);

            activity.Complete(); // Perform event

            // Make assertions
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.EndTime));
            Assert.AreEqual(ActivityStatus.CM, activity.State);
            Assert.IsTrue(RoughlyEqual(Platform.Time, activity.LastStateChangeTime));
        }
Exemplo n.º 53
0
 public void Test_Schedule_FromNonScheduledState()
 {
     ConcreteActivity activity = new ConcreteActivity();
     activity.Start(new ConcreteActivityPerformer());
     activity.Schedule(DateTime.Now, DateTime.Now + TimeSpan.FromDays(3));
 }
Exemplo n.º 54
0
        public void Test_Assign()
        {
            ConcreteActivity activity = new ConcreteActivity();
            ConcreteActivityPerformer activityPerformer = new ConcreteActivityPerformer();

            activity.Assign(activityPerformer);

            Assert.IsNotNull(activity.Scheduling);
            Assert.AreEqual(activityPerformer, activity.Scheduling.Performer);
            Assert.AreEqual(ActivityStatus.SC, activity.State);
        }