public void ConvertError_ForFailureResult() { ParseResult <int> original = ParseResult <int> .ForInvalidValue("text"); ParseResult <string> converted = original.ConvertError <string>(); Assert.Throws <UnparsableValueException>(() => converted.GetValueOrThrow()); }
public void ConvertError_ForSuccessResult() { ParseResult <int> original = ParseResult <int> .ForValue(10); Assert.Throws <InvalidOperationException>(() => original.ConvertError <string>()); }
public void ConvertError_ForFailureResult() { ParseResult <string> converted = FailureResult.ConvertError <string>(); Assert.Throws <UnparsableValueException>(() => converted.GetValueOrThrow()); }