public void BindDifferentTypesTogetherWithOnesThatOnlyReturnResult() { IResult res = FakeService.DoDivision(100, 2) .Bind((x) => FakeService.DoStringStuff(x.ToString())) .Bind(FakeService.FakeVoidMethod); Assert.True(res.IsOk); }
public void BindDifferentTypesTogether() { var res = FakeService.DoDivision(100, 2) .Bind((x) => FakeService.DoStringStuff(x.ToString())); Assert.True(res.IsOk); Assert.Equal("*** 50 ***", res.GetSuccess <string>().Value); }
public void BindDifferentTypesTogetherIgnoringPreviousResult() { //This should never be done, but for the shake of it... var res = FakeService.DoDivision(100, 2) .Bind((x) => FakeService.DoStringStuff(x.ToString())) .Bind((s) => FakeService.DoDivision(10, 2)); Assert.True(res.IsOk); Assert.Equal(5.0, res.GetSuccess <double>().Value); }