public void TestUpdateDbGood() { var canonicalizeEmailR = Rop.Lift <SimpleRequest, SimpleRequest, string>(CanonicalizeEmail); var updateDbR = Rop.SuccessTee <SimpleRequest, string>(input => UpdateDatabase(input)); var goodRequest = GoodRequest; var result = goodRequest .Pipe(ValidateRequest) .Pipe(canonicalizeEmailR) .Pipe(updateDbR); Assert.IsTrue(result.IsSuccess); }
//============================================== // helpers //============================================== // log values on the success path private Func <RopResult <T, DomainMessage>, RopResult <T, DomainMessage> > LogSuccessR <T>(string format) { return(Rop.SuccessTee <T, DomainMessage>(v => Log(format, v))); }