Example #1
0
        private KoanResult combineContainersUnlessFailed(KoanResult state, KoanResult next)
        {

            if (state is Success)
                return combine(joinContainers, state.Message, next);
            else return state;

        }
Example #2
0
        private KoanResult combine(Func<string, string, string> joinMessages, string message, KoanResult next)
        {
            var newMsg = joinMessages(message, next.Message);

            if (next is Success)
                return new Success(newMsg);
            else
                return new Failure(newMsg, (next as Failure).Exception);
        }
Example #3
0
 private KoanResult combineLinesUnlessFailed(KoanResult state, KoanResult next)
 {
     if (state is Success)
     {
         return(combine(joinLines, state.Message, next));
     }
     else
     {
         return(state);
     }
 }
Example #4
0
        private KoanResult combine(Func <string, string, string> joinMessages, string message, KoanResult next)
        {
            var newMsg = joinMessages(message, next.Message);

            if (next is Success)
            {
                return(new Success(newMsg));
            }
            else
            {
                return(new Failure(newMsg, (next as Failure).Exception));
            }
        }