Exemplo n.º 1
0
        public void ToString_SourceFailureToStringReturnsNull_ExpectEmpty()
        {
            var sourceFailure = new StubToStringStructType(null);
            var builder       = Result.Failure(sourceFailure);

            var actual = builder.ToString();

            Assert.IsEmpty(actual);
        }
Exemplo n.º 2
0
        public void ToString_SourceIsFailureAndValueToStringReturnsNull_ExpectEmptyString()
        {
            var sourceValue = new StubToStringStructType(null);
            var source      = Result <RefType?, StubToStringStructType> .Failure(sourceValue);

            var actual = source.ToString();

            Assert.IsEmpty(actual);
        }
Exemplo n.º 3
0
        public void ToString_SourceFailureToStringReturnsNotNull_ExpectResultOfSourceFailureToString(
            string resultOfFailureToString)
        {
            var sourceFailure = new StubToStringStructType(resultOfFailureToString);
            var builder       = Result.Failure(sourceFailure);

            var actual = builder.ToString();

            Assert.AreEqual(resultOfFailureToString, actual);
        }
Exemplo n.º 4
0
        public void ToString_SourceIsFailureAndValueToStringDoesNotReturnNull_ExpectResultOfValueToString(
            string resultOfValueToString)
        {
            var sourceValue = new StubToStringStructType(resultOfValueToString);
            var source      = new Result <StructType, StubToStringStructType>(sourceValue);

            var actual = source.ToString();

            Assert.AreEqual(resultOfValueToString, actual);
        }
Exemplo n.º 5
0
        public void ToString_SourceIsSuccessAndValueToStringDoesNotReturnNull_ExpectResultOfValueToString(
            string resultOfValueToString)
        {
            var sourceValue = new StubToStringStructType(resultOfValueToString);
            var source      = Result <StubToStringStructType, SomeError> .Success(sourceValue);

            var actual = source.ToString();

            Assert.AreEqual(resultOfValueToString, actual);
        }