コード例 #1
0
ファイル: StringMatchers.cs プロジェクト: tammylotter/NExpect
 /// <summary>
 /// Continue testing a string for another substring
 /// </summary>
 /// <param name="continuation">Existing continuation fron a Contain()</param>
 /// <param name="search">string to search for</param>
 /// <returns>IStringContainContinuation onto which you can chain .And</returns>
 public static IStringMore And(
     this IStringContainContinuation continuation,
     string search
     )
 {
     return(continuation.And(search, NULL_STRING));
 }
コード例 #2
0
ファイル: StringMatchers.cs プロジェクト: tammylotter/NExpect
 /// <summary>
 /// Continue testing a string for another substring
 /// </summary>
 /// <param name="continuation">Existing continuation fron a Contain()</param>
 /// <param name="search">string to search for</param>
 /// <param name="customMessage">Custom message to include in failure messages</param>
 /// <returns>IStringContainContinuation onto which you can chain .And</returns>
 public static IStringMore And(
     this IStringContainContinuation continuation,
     string search,
     string customMessage
     )
 {
     return(continuation.And(search, () => customMessage));
 }
コード例 #3
0
 public static IStringContainContinuation And(
     this IStringContainContinuation continuation,
     string search
     )
 {
     AddContainsMatcherTo(continuation, search);
     return(new StringContainContinuation(continuation));
 }
コード例 #4
0
ファイル: StringMatchers.cs プロジェクト: tammylotter/NExpect
        /// <summary>
        /// Continue testing a string for another substring from beyond the end of the last match
        /// </summary>
        /// <param name="continuation">Continuation to operate on</param>
        /// <param name="search">String to search for</param>
        /// <param name="customMessageGenerator">Generates a custom message to include in failure messages</param>
        /// <returns></returns>
        public static IStringMore Then(
            this IStringContainContinuation continuation,
            string search,
            Func <string> customMessageGenerator
            )
        {
            var result = new StringContainContinuation(continuation);

            AddContainsMatcherTo(continuation, search, customMessageGenerator, result);
            return(result);
        }
コード例 #5
0
ファイル: StringMatchers.cs プロジェクト: tammylotter/NExpect
        /// <summary>
        /// Continue testing a string for another substring
        /// </summary>
        /// <param name="continuation">Existing continuation fron a Contain()</param>
        /// <param name="search">string to search for</param>
        /// <param name="customMessageGenerator">Generates a custom message to include in failure messages</param>
        /// <returns>IStringContainContinuation onto which you can chain .And</returns>
        public static IStringMore And(
            this IStringContainContinuation continuation,
            string search,
            Func <string> customMessageGenerator
            )
        {
            var result = new StringContainContinuation(continuation);

            continuation.SetMetadata(SEARCH_OFFSET, 0); // And will reset the offset -- it's not ordered
            AddContainsMatcherTo(continuation, search, customMessageGenerator, result);
            return(result);
        }