public void WithCause_Check_IsOk()
        {
            var newCause = new Exception("newCause");

            var appEx = _appEx.WithCause(newCause);

            Assert.Equal(_appEx, appEx);
            Assert.Equal(newCause.Message, appEx.Cause);
        }
        public void Constructor_WithCouse_IsOk()
        {
            var ex = new Exception();

            var appEx = new ApplicationException();

            appEx.WithCause(ex);

            Assert.Equal(ex.Message, appEx.Cause);
        }
        public static ApplicationException WrapException(ApplicationException error, Exception cause)
        {
            if (cause is ApplicationException)
            {
                return((ApplicationException)cause);
            }

            error.WithCause(cause);
            return(error);
        }