Exemple #1
0
        /// <summary>
        /// Gets the trace formatter for formatting an HTTP request.
        /// </summary>
        /// <param name="shouldMask">True, if fields should be masked, false
        /// otherwise.</param>
        /// <returns>A trace formatter for formatting HTTP request.</returns>
        private TraceFormatter GetTraceFormatterForHTTPRequests(bool shouldMask)
        {
            TraceFormatter formatter = null;

            if (shouldMask)
            {
                formatter = new UrlEncodedBodyFormatter();
            }
            else
            {
                formatter = new DefaultBodyFormatter();
            }
            return(formatter);
        }
 public void TestMaskContents() {
   string maskedBody = new UrlEncodedBodyFormatter().MaskContents(BODY, KEYS);
   Assert.AreEqual(FORMATTED_BODY, maskedBody);
 }
 /// <summary>
 /// Gets the trace formatter for formatting an HTTP request.
 /// </summary>
 /// <param name="shouldMask">True, if fields should be masked, false
 /// otherwise.</param>
 /// <returns>A trace formatter for formatting HTTP request.</returns>
 private TraceFormatter GetTraceFormatterForHTTPRequests(bool shouldMask) {
   TraceFormatter formatter = null;
   if (shouldMask) {
     formatter = new UrlEncodedBodyFormatter();
   } else {
     formatter = new DefaultBodyFormatter();
   }
   return formatter;
 }