Beispiel #1
0
 internal static Func <string> MessageForNotMatchResult(
     bool passed,
     string src,
     Func <string> customMessageGenerator
     )
 {
     return(FinalMessageFor(
                () => $"Expected {Quote(src)} {passed.AsNot()}to be matched",
                customMessageGenerator
                ));
 }
Beispiel #2
0
 internal static Func <string> MessageForNotContainsResult(
     bool passed,
     string src,
     string search,
     Func <string> customMessageGenerator
     )
 {
     return(FinalMessageFor(
                () => $"Expected {Quote(src)} {passed.AsNot()}to contain {Quote(search)}",
                customMessageGenerator
                ));
 }
Beispiel #3
0
        private static string DumpCalls(
            ICall[] calls,
            bool passed
            )
        {
            var callInfo = calls.Aggregate(
                new List <string>(),
                (acc, cur) =>
            {
                acc.Add(DumpCallInfo(cur));
                return(acc);
            }).JoinWith("\n*").Trim();

            return($@"Expected {passed.AsNot()}to have received any calls, but received {
                    (callInfo.IsNullOrWhiteSpace() ? "none" : callInfo)
                }");
        }