Пример #1
0
        public void ConvertError_ForFailureResult()
        {
            ParseResult <int> original = ParseResult <int> .ForInvalidValue("text");

            ParseResult <string> converted = original.ConvertError <string>();

            Assert.Throws <UnparsableValueException>(() => converted.GetValueOrThrow());
        }
Пример #2
0
        public void ConvertError_ForSuccessResult()
        {
            ParseResult <int> original = ParseResult <int> .ForValue(10);

            Assert.Throws <InvalidOperationException>(() => original.ConvertError <string>());
        }
Пример #3
0
        public void ConvertError_ForFailureResult()
        {
            ParseResult <string> converted = FailureResult.ConvertError <string>();

            Assert.Throws <UnparsableValueException>(() => converted.GetValueOrThrow());
        }