Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }