コード例 #1
0
        public void Exceptions_during_the_execution_of_the_decorated_operation_are_not_propagated()
        {
            var operation = new FakeOperation { ThrowOnExecute = new Exception() };
            var sut = new ContinueOnFailureBehavior();
            sut.AttachTo(operation);

            sut.Execute();
        }
コード例 #2
0
        public void Contained_errors_are_logged(Exception error, FakeWorkflowLogger log)
        {
            var sut = new ContinueOnFailureBehavior().AttachTo(new FakeOperation { ThrowOnExecute = error });
            sut.Initialize(new FakeWorkflowConfiguration { Logger = log });

            sut.Execute();

            Assert.Equal(1, log.AppliedBehaviors.Count);
            Assert.Equal("Error swallowed", log.AppliedBehaviors[0].Description);
        }