Files
WireMock.Net/src/WireMock/RequestPathSpec.cs
2017-01-17 22:44:21 +01:00

55 lines
1.7 KiB
C#

using System.Diagnostics.CodeAnalysis;
[module:
SuppressMessage("StyleCop.CSharp.ReadabilityRules",
"SA1101:PrefixLocalCallsWithThis",
Justification = "Reviewed. Suppression is OK here, as it conflicts with internal naming rules.")]
[module:
SuppressMessage("StyleCop.CSharp.NamingRules",
"SA1309:FieldNamesMustNotBeginWithUnderscore",
Justification = "Reviewed. Suppression is OK here, as it conflicts with internal naming rules.")]
[module:
SuppressMessage("StyleCop.CSharp.DocumentationRules",
"SA1633:FileMustHaveHeader",
Justification = "Reviewed. Suppression is OK here, as unknown copyright and company.")]
// ReSharper disable ArrangeThisQualifier
// ReSharper disable InconsistentNaming
namespace WireMock
{
/// <summary>
/// The request path spec.
/// </summary>
public class RequestPathSpec : ISpecifyRequests
{
/// <summary>
/// The _path.
/// </summary>
private readonly string _path;
/// <summary>
/// Initializes a new instance of the <see cref="RequestPathSpec"/> class.
/// </summary>
/// <param name="path">
/// The path.
/// </param>
public RequestPathSpec(string path)
{
_path = path;
}
/// <summary>
/// The is satisfied by.
/// </summary>
/// <param name="request">
/// The request.
/// </param>
/// <returns>
/// The <see cref="bool"/>.
/// </returns>
public bool IsSatisfiedBy(Request request)
{
return WildcardPatternMatcher.MatchWildcardString(_path, request.Path);
}
}
}