public IHttpActionResult SyncOperationException()
        {
            var bo = new BusinessObjectException();

            bo.Operation();

            return(Ok($"Completed Count: {bo.CompletedCount}"));
        }
Пример #2
0
        public void SyncOperationException()
        {
            //Fails
            // The exception in the event handler is never caught

            var bo = new BusinessObjectException();

            Exception ex = null;

            try
            {
                bo.Operation();
            }
            catch (Exception ex_)
            {
                ex = ex_;
            }

            Assert.IsNotNull(ex);
        }