public void ResolvedWithBoolErr_UnwrapValueThrowsException() { Resolved <int, bool> resolved = Resolved.Err(true); Assert.Throws(typeof(InvalidOperationException), () => resolved.Unwrap()); }
public void ResolvedWithOkTypeAndErrType_UnwrapValue() { Resolved <bool, string> resolved = Resolved.Ok(true); var value = resolved.Unwrap(); Assert.IsTrue(value); }
public void ResolvedWithDefaultErr_UnwrapValueThrowsException() { Resolved <int> resolved = Resolved.ErrAsIEnumerable(new Exception()); Assert.Throws(typeof(InvalidOperationException), () => resolved.Unwrap()); }
public void ResolvedWithIntegerOk_UnwrapValue() { Resolved <int> resolved = Resolved.Ok(5); var value = resolved.Unwrap(); Assert.AreEqual(5, value); }