public IPathParameterMatcher Create(string path)
        {
            if (string.IsNullOrWhiteSpace(path))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(path));
            }

            return(new PathParameterMatcher(_regexConverter.Convert(path)));
        }
예제 #2
0
        public OperationMatcher(
            OperationInfo operation,
            IPathPatternToRegexConverter pathPatternToRegexConverter,
            IQueryStringParameterMatcher queryStringParameterMatcher,
            IHeaderParameterMatcher headerParameterMatcher,
            IBodyParameterMatcher bodyParameterMatcher)
        {
            if (pathPatternToRegexConverter == null)
            {
                throw new ArgumentNullException(nameof(pathPatternToRegexConverter));
            }

            _bodyParameterMatcher        = bodyParameterMatcher ?? throw new ArgumentNullException(nameof(bodyParameterMatcher));
            _headerParameterMatcher      = headerParameterMatcher ?? throw new ArgumentNullException(nameof(headerParameterMatcher));
            _queryStringParameterMatcher = queryStringParameterMatcher ?? throw new ArgumentNullException(nameof(queryStringParameterMatcher));

            _operation = operation ?? throw new ArgumentNullException(nameof(operation));
            _regexInfo = pathPatternToRegexConverter.Convert(operation.Path);
        }