Beispiel #1
0
 public void Start_after_fault_failure()
 {
     var monitor = new TransitionMonitor("init", "svc");
     monitor.Start();
     monitor.Fault(new Exception());
     Assert.Throws<ServiceTransitioningException>(() => monitor.Start());
 }
 public void Start_after_fault_failure()
 {
     var monitor = new TransitionMonitor("init", "svc");
     monitor.Start();
     monitor.Fault();
     monitor.Start();
 }
 public void Start_after_complete_failure()
 {
     var monitor = new TransitionMonitor("init", "svc");
     monitor.Start();
     monitor.Complete();
     monitor.Start();
 }
Beispiel #4
0
 public void Start_successful()
 {
     var monitor = new TransitionMonitor("init", "svc");
     monitor.Start();
     Assert.IsFalse(monitor.IsNotStarted);
     Assert.IsTrue(monitor.IsInProgress);
     Assert.IsFalse(monitor.IsCompleted);
     Assert.IsFalse(monitor.IsCompletedSuccessfully);
     Assert.IsFalse(monitor.IsFaulted);
 }
Beispiel #5
0
 public void Reset_from_faulted_success()
 {
     var monitor = new TransitionMonitor("init", "svc");
     monitor.Start();
     monitor.Fault(new Exception());
     monitor.Reset();
     Assert.IsTrue(monitor.IsNotStarted);
     Assert.IsFalse(monitor.IsInProgress);
     Assert.IsFalse(monitor.IsCompleted);
     Assert.IsFalse(monitor.IsCompletedSuccessfully);
     Assert.IsFalse(monitor.IsFaulted);
 }
Beispiel #6
0
 public void Complete_on_faulted_failure()
 {
     var monitor = new TransitionMonitor("init", "svc");
     monitor.Start();
     monitor.Fault(new Exception());
     Assert.Throws<ServiceTransitioningException>(() => monitor.Complete());
 }
 public void Start_twice_failure()
 {
     var monitor = new TransitionMonitor("init", "svc");
     monitor.Start();
     monitor.Start();
 }
 public void Complete_on_faulted_failure()
 {
     var monitor = new TransitionMonitor("init", "svc");
     monitor.Start();
     monitor.Fault();
     monitor.Complete();
 }