Пример #1
0
        public void From_if_predicate_is_true_returns_ok_ResultWithError()
        {
            var error  = "error";
            var result = ResultWithError.From(() => true, error);

            result.IsSuccess.ShouldBeTrue();
        }
Пример #2
0
        public void From_if_predicate_is_false_returns_fail_ResultWithError_with_error()
        {
            var error  = "error";
            var result = ResultWithError.From(() => false, error);

            result.IsFailure.ShouldBeTrue();
            result.Error.ShouldBe(error);
        }