Beispiel #1
0
        public void InlineMethodWay()
        {
            var config = new SimpleConfigStreamType {
                Divider = 10
            };
            var task = StreamProcessRunner.CreateAndExecuteAsync(config, SimpleJob.Job1);

            task.Wait();
            CollectionAssert.AreEquivalent(new[] { $"{100 / 10} times hello world!" }, config.Messages.ToArray());
        }
Beispiel #2
0
        public void InlineMethodWay()
        {
            var config = new SimpleConfigStreamType {
                Divider = 0
            };
            var task = StreamProcessRunner.CreateAndExecuteWithNoFaultAsync(config, SimpleJob.Job1);

            task.Wait();
            Assert.IsTrue(task.Result.Failed, "the execution should not be successfull");
            Assert.IsInstanceOfType((task.Result.EndOfProcessTraceEvent?.Content as UnhandledExceptionStreamTraceContent)?.Exception, typeof(DivideByZeroException));
        }
Beispiel #3
0
        public void InlineMethodWay()
        {
            var config = new SimpleConfigStreamType {
                Divider = 0
            };
            var task = StreamProcessRunner.CreateAndExecuteAsync(config, SimpleJob.Job1);

            try
            {
                task.Wait();
                Assert.Fail("the execution should not be successfull");
            }
            catch (AggregateException ex)
            {
                JobExecutionException jobExecutionException = ex.InnerException as JobExecutionException;
                if (jobExecutionException == null)
                {
                    throw;
                }
                Assert.IsInstanceOfType(jobExecutionException.InnerException, typeof(DivideByZeroException));
                Assert.IsInstanceOfType((jobExecutionException.TraceEvent?.Content as UnhandledExceptionStreamTraceContent)?.Exception, typeof(DivideByZeroException));
            }
        }