private void Test(bool throwException) { currentUnitOfWork.OnSuccessCall(() => { successCall = true; }); currentUnitOfWork.OnFailureCall(e => { failureCall = true; }); if (throwException) { throw new TestException(); } }