예제 #1
0
        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);
        }
예제 #2
0
        //==============================================
        // 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)));
        }