public void Start() { ManagerMock test = ManagerMock.Instantiate(applicationManagerMock.Object); // start the manager and assert that it is running IResult start = test.Start(); Assert.Equal(State.Running, test.State); // try to start again and assert that the operation fails IResult startAgain = test.Start(); Assert.Equal(ResultCode.Failure, startAgain.ResultCode); }
public void StartWithStoppedDependency() { Mock <IApplicationManager> a = new Mock <IApplicationManager>(); a.Setup(m => m.State).Returns(State.Stopped); ManagerMock test = ManagerMock.Instantiate(a.Object); // start the manager and assert that it is running IResult start = test.Start(); Assert.Equal(ResultCode.Failure, start.ResultCode); }
public void Restart() { ManagerMock test = ManagerMock.Instantiate(applicationManagerMock.Object); // start the manager and assert that it is running test.Start(); Assert.Equal(State.Running, test.State); // restart the manager and assert that the operation succeeded IResult restart = test.Restart(); Assert.Equal(ResultCode.Success, restart.ResultCode); Assert.Equal(State.Running, test.State); }