public void DependencyFault() { ManagerMockTwo o = ManagerMockTwo.Instantiate(applicationManagerMock.Object); o.Start(); ManagerMockWithDependency test = ManagerMockWithDependency.Instantiate(applicationManagerMock.Object, o); // start the manager and assert that it is running IResult start = test.Start(); Assert.Equal(State.Running, test.State); // fault the manager upon which the test manager is dependent ensure that this manager stops.start the other manager // and ensure that this manager remains stopped. o.Fault(); Assert.Equal(State.Faulted, o.State); Assert.Equal(State.Stopped, test.State); Assert.Equal(true, test.AutomaticRestartPending); o.Start(); Assert.Equal(State.Running, o.State); // wait 1500ms for the manager to restart (the restart timer is set for 500ms) Thread.Sleep(1500); // assert that the manager has restarted. Assert.Equal(State.Running, test.State); }
public void Fault() { ManagerMockTwo test = ManagerMockTwo.Instantiate(applicationManagerMock.Object); test.Start(); Assert.Equal(State.Running, test.State); test.Fault(); Assert.Equal(State.Faulted, test.State); test.Start(); Assert.Equal(State.Running, test.State); test.FaultWithRestart(); Assert.Equal(State.Faulted, test.State); }