Пример #1
0
        public RecordEntry Lookup(RecordEntry requestEntry, RecordMatcher matcher, RecordedTestSanitizer sanitizer, bool remove = true)
        {
            sanitizer.Sanitize(requestEntry);

            lock (Entries)
            {
                RecordEntry entry = matcher.FindMatch(requestEntry, Entries);
                if (remove)
                {
                    Entries.Remove(entry);
                }
                return(entry);
            }
        }
Пример #2
0
        public RecordEntry Lookup(RecordEntry requestEntry, RecordMatcher matcher, IEnumerable <RecordedTestSanitizer> sanitizers, bool remove = true)
        {
            foreach (RecordedTestSanitizer sanitizer in sanitizers)
            {
                sanitizer.Sanitize(requestEntry);
            }

            lock (Entries)
            {
                RecordEntry entry = matcher.FindMatch(requestEntry, Entries);
                if (remove)
                {
                    Entries.Remove(entry);
                }
                return(entry);
            }
        }
Пример #3
0
        public RecordEntry Lookup(RecordEntry requestEntry, RecordMatcher matcher, IEnumerable <RecordedTestSanitizer> sanitizers, bool remove = true)
        {
            foreach (RecordedTestSanitizer sanitizer in sanitizers)
            {
                sanitizer.Sanitize(requestEntry);
            }
            // normalize request body with STJ using relaxed escaping to match behavior when Deserializing from session files
            RecordEntry.NormalizeJsonBody(requestEntry.Request);

            lock (Entries)
            {
                RecordEntry entry = matcher.FindMatch(requestEntry, Entries);
                if (remove)
                {
                    Entries.Remove(entry);
                }

                return(entry);
            }
        }