public void OrElse() { Result00.Ok(new T0(0)).OrElse(_ => Result01.Ok(new T0(1))).Should().Be(Result01.Ok(new T0(0))); Result00.Ok(new T0(0)).OrElse(_ => Result01.Err(new E1(1))).Should().Be(Result01.Ok(new T0(0))); Result00.Err(new E0(0)).OrElse(_ => Result01.Ok(new T0(1))).Should().Be(Result01.Ok(new T0(1))); Result00.Err(new E0(0)).OrElse(_ => Result01.Err(new E1(1))).Should().Be(Result01.Err(new E1(1))); }
public void OrWorks() { Result00.Ok(new T0(0)).Or(Result01.Ok(new T0(1))).Should().Be(Result01.Ok(new T0(0))); Result00.Ok(new T0(0)).Or(Result01.Err(new E1(1))).Should().Be(Result01.Ok(new T0(0))); Result00.Err(new E0(0)).Or(Result01.Ok(new T0(1))).Should().Be(Result01.Ok(new T0(1))); Result00.Err(new E0(0)).Or(Result01.Err(new E1(1))).Should().Be(Result01.Err(new E1(1))); }