public void TestError__AlreadyErrored() { TaskStatus status = new TaskStatus(); Exception ex = new Exception(); status.Error(ex); Assert.Throws <InvalidOperationException>(delegate { status.Error(new Exception()); }); Assert.False(status.IsRunning); Assert.False(status.IsFinished); Assert.True(status.IsExitedWithError); Assert.Same(ex, status.Exception); }
public void TestError() { TaskStatus status = new TaskStatus(); Exception ex = new Exception(); status.Error(ex); Assert.False(status.IsRunning); Assert.False(status.IsFinished); Assert.True(status.IsExitedWithError); Assert.Same(ex, status.Exception); }