Пример #1
0
        public void IfFailure_FuncStringSuccess_DoesNotCallFunc()
        {
            var called = false;

            InterceptorResult.IfFailure(false, () =>
            {
                called = true;
                return(Message);
            });

            Assert.False(called);
        }
Пример #2
0
        public void IfFailure_FuncStringFail_GivesMessage()
        {
            var result = InterceptorResult.IfFailure(true, () => Message);

            Assert.Equal(Message, result.Message);
        }
Пример #3
0
        public void IfFailure_FuncStringFail_GivesFail()
        {
            var result = InterceptorResult.IfFailure(true, () => Message);

            Assert.False(result.IsSuccess);
        }
Пример #4
0
        public void IfFailure_FuncStringSuccess_GivesSuccess()
        {
            var result = InterceptorResult.IfFailure(false, () => Message);

            Assert.True(result.IsSuccess);
        }