Skip to content

Commit

Permalink
chore!: change visibility fo all matcher implementations to internal
Browse files Browse the repository at this point in the history
  • Loading branch information
skwasjer committed Sep 29, 2024
1 parent aeac3f9 commit 10cc171
Show file tree
Hide file tree
Showing 20 changed files with 16 additions and 580 deletions.
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/AnyMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by verifying it against a list of constraints, for which at least one has to match the request.
/// </summary>
public class AnyMatcher : IAsyncHttpRequestMatcher
internal sealed class AnyMatcher : IAsyncHttpRequestMatcher
{
/// <summary>
/// Initializes a new instance of the <see cref="AnyMatcher" /> class using specified list of <paramref name="matchers" />.
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/ContentMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by the request content.
/// </summary>
public class ContentMatcher : IAsyncHttpRequestMatcher
internal class ContentMatcher : IAsyncHttpRequestMatcher
{
private const int MaxBytesDisplayed = 10;

Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/ExpressionMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request using a custom expression.
/// </summary>
public class ExpressionMatcher : HttpRequestMatcher
internal sealed class ExpressionMatcher : HttpRequestMatcher
{
private readonly string _funcDisplay;
private readonly Func<HttpRequestMessage, bool> _func;
Expand Down
6 changes: 3 additions & 3 deletions src/MockHttp/Matchers/FormDataMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by the posted form data.
/// </summary>
public class FormDataMatcher : IAsyncHttpRequestMatcher
internal sealed class FormDataMatcher : IAsyncHttpRequestMatcher
{
internal const string MultipartFormDataMediaType = "multipart/form-data";

Expand Down Expand Up @@ -43,7 +43,7 @@ public FormDataMatcher(string urlEncodedFormData)
}

/// <inheritdoc />
public virtual Task<bool> IsMatchAsync(MockHttpRequestContext requestContext)
public Task<bool> IsMatchAsync(MockHttpRequestContext requestContext)
{
if (requestContext is null)
{
Expand Down Expand Up @@ -85,7 +85,7 @@ private static bool HasOneOf(IEnumerable<string> left, IEnumerable<string> right
}

/// <inheritdoc />
public virtual bool IsExclusive => _matchQs.Count == 0;
public bool IsExclusive => _matchQs.Count == 0;

/// <inheritdoc />
public override string ToString()
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/HttpHeadersMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by the request headers.
/// </summary>
public class HttpHeadersMatcher : ValueMatcher<HttpHeaders>
internal sealed class HttpHeadersMatcher : ValueMatcher<HttpHeaders>
{
private readonly HttpHeaderEqualityComparer _equalityComparer;

Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/HttpMethodMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by HTTP method.
/// </summary>
public class HttpMethodMatcher : ValueMatcher<HttpMethod>
internal sealed class HttpMethodMatcher : ValueMatcher<HttpMethod>
{
/// <summary>
/// Initializes a new instance of the <see cref="HttpMethodMatcher" /> class using specified <paramref name="method" />.
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/HttpRequestMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Represents a condition for matching a <see cref="HttpRequestMessage" />.
/// </summary>
public abstract class HttpRequestMatcher : IAsyncHttpRequestMatcher
internal abstract class HttpRequestMatcher : IAsyncHttpRequestMatcher
{
/// <summary>
/// Initializes a new instance of the <see cref="HttpRequestMatcher" /> class.
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/MediaTypeHeaderMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by the media type header.
/// </summary>
public class MediaTypeHeaderMatcher : ValueMatcher<MediaTypeHeaderValue>
internal sealed class MediaTypeHeaderMatcher : ValueMatcher<MediaTypeHeaderValue>
{
/// <summary>
/// Initializes a new instance of the <see cref="MediaTypeHeaderMatcher" /> class.
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/NotMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matcher that inverts the final result of matching a set of inner matchers.
/// </summary>
internal class NotMatcher : IAsyncHttpRequestMatcher
internal sealed class NotMatcher : IAsyncHttpRequestMatcher
{
private readonly IAsyncHttpRequestMatcher _matcher;

Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/PartialContentMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by partially matching the request content.
/// </summary>
public class PartialContentMatcher : ContentMatcher
internal sealed class PartialContentMatcher : ContentMatcher
{
/// <summary>
/// Initializes a new instance of the <see cref="PartialContentMatcher" /> class using specified <paramref name="content" />.
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/QueryStringMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by the request URI query string.
/// </summary>
public class QueryStringMatcher : HttpRequestMatcher
internal sealed class QueryStringMatcher : HttpRequestMatcher
{
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly QueryString _matchQs;
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/UriMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by the URI.
/// </summary>
internal class UriMatcher : HttpRequestMatcher
internal sealed class UriMatcher : HttpRequestMatcher
{
private readonly string _name;
private readonly Pattern _pattern;
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/ValueMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Base class that matches a request by a value.
/// </summary>
/// <typeparam name="T">The type of the value to match.</typeparam>
public abstract class ValueMatcher<T> : HttpRequestMatcher
internal abstract class ValueMatcher<T> : HttpRequestMatcher
{
/// <summary>
/// Initializes a new instance of the <see cref="ValueMatcher{T}" /> class using specified <paramref name="value" />.
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/VersionMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace MockHttp.Matchers;
/// <summary>
/// Matches a request by the HTTP message version.
/// </summary>
public class VersionMatcher : ValueMatcher<Version>
internal sealed class VersionMatcher : ValueMatcher<Version>
{
/// <summary>
/// Initializes a new instance of the <see cref="VersionMatcher" /> class using specified <paramref name="version" />.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,105 +371,11 @@ namespace MockHttp.Language.Response
}
namespace MockHttp.Matchers
{
public class AnyMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher
{
public AnyMatcher(System.Collections.Generic.IReadOnlyCollection<MockHttp.Matchers.IAsyncHttpRequestMatcher> matchers) { }
public bool IsExclusive { get; }
public System.Collections.Generic.IReadOnlyCollection<MockHttp.Matchers.IAsyncHttpRequestMatcher> Matchers { get; }
public System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class ContentMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher
{
public ContentMatcher() { }
public ContentMatcher(byte[] content) { }
public ContentMatcher(string content, System.Text.Encoding? encoding) { }
protected System.Collections.Generic.IReadOnlyList<byte> ByteContent { get; }
public virtual bool IsExclusive { get; }
protected virtual bool IsMatch(byte[] requestContent) { }
public System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class ExpressionMatcher : MockHttp.Matchers.HttpRequestMatcher
{
public ExpressionMatcher(System.Linq.Expressions.Expression<System.Func<System.Net.Http.HttpRequestMessage, bool>> expression) { }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class FormDataMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher
{
public FormDataMatcher(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, System.Collections.Generic.IEnumerable<string>>> formData) { }
public FormDataMatcher(string urlEncodedFormData) { }
public virtual bool IsExclusive { get; }
public virtual System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class HttpHeadersMatcher : MockHttp.Matchers.ValueMatcher<System.Net.Http.Headers.HttpHeaders>
{
public HttpHeadersMatcher(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, System.Collections.Generic.IEnumerable<string>>> headers) { }
public HttpHeadersMatcher(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> headers) { }
public HttpHeadersMatcher(string name) { }
public HttpHeadersMatcher(string name, System.Collections.Generic.IEnumerable<string> values) { }
public HttpHeadersMatcher(string name, string value, bool allowWildcards = false) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class HttpMethodMatcher : MockHttp.Matchers.ValueMatcher<System.Net.Http.HttpMethod>
{
public HttpMethodMatcher(System.Net.Http.HttpMethod method) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public abstract class HttpRequestMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher
{
protected HttpRequestMatcher() { }
public virtual bool IsExclusive { get; }
public abstract bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext);
public System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public abstract override string ToString() { }
}
public interface IAsyncHttpRequestMatcher
{
bool IsExclusive { get; }
System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext);
}
public class MediaTypeHeaderMatcher : MockHttp.Matchers.ValueMatcher<System.Net.Http.Headers.MediaTypeHeaderValue>
{
public MediaTypeHeaderMatcher(System.Net.Http.Headers.MediaTypeHeaderValue headerValue) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class PartialContentMatcher : MockHttp.Matchers.ContentMatcher
{
public PartialContentMatcher(byte[] content) { }
public PartialContentMatcher(string content, System.Text.Encoding? encoding) { }
public override bool IsExclusive { get; }
protected override bool IsMatch(byte[] requestContent) { }
public override string ToString() { }
}
public class QueryStringMatcher : MockHttp.Matchers.HttpRequestMatcher
{
public QueryStringMatcher(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, System.Collections.Generic.IEnumerable<string>>> parameters) { }
public QueryStringMatcher(string queryString) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public abstract class ValueMatcher<T> : MockHttp.Matchers.HttpRequestMatcher
{
protected ValueMatcher(T value) { }
protected T Value { get; }
}
public class VersionMatcher : MockHttp.Matchers.ValueMatcher<System.Version>
{
public VersionMatcher(System.Version version) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
}
namespace MockHttp.Responses
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,105 +372,11 @@ namespace MockHttp.Language.Response
}
namespace MockHttp.Matchers
{
public class AnyMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher
{
public AnyMatcher(System.Collections.Generic.IReadOnlyCollection<MockHttp.Matchers.IAsyncHttpRequestMatcher> matchers) { }
public bool IsExclusive { get; }
public System.Collections.Generic.IReadOnlyCollection<MockHttp.Matchers.IAsyncHttpRequestMatcher> Matchers { get; }
public System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class ContentMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher
{
public ContentMatcher() { }
public ContentMatcher(byte[] content) { }
public ContentMatcher(string content, System.Text.Encoding? encoding) { }
protected System.Collections.Generic.IReadOnlyList<byte> ByteContent { get; }
public virtual bool IsExclusive { get; }
protected virtual bool IsMatch(byte[] requestContent) { }
public System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class ExpressionMatcher : MockHttp.Matchers.HttpRequestMatcher
{
public ExpressionMatcher(System.Linq.Expressions.Expression<System.Func<System.Net.Http.HttpRequestMessage, bool>> expression) { }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class FormDataMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher
{
public FormDataMatcher(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, System.Collections.Generic.IEnumerable<string>>> formData) { }
public FormDataMatcher(string urlEncodedFormData) { }
public virtual bool IsExclusive { get; }
public virtual System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class HttpHeadersMatcher : MockHttp.Matchers.ValueMatcher<System.Net.Http.Headers.HttpHeaders>
{
public HttpHeadersMatcher(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, System.Collections.Generic.IEnumerable<string>>> headers) { }
public HttpHeadersMatcher(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> headers) { }
public HttpHeadersMatcher(string name) { }
public HttpHeadersMatcher(string name, System.Collections.Generic.IEnumerable<string> values) { }
public HttpHeadersMatcher(string name, string value, bool allowWildcards = false) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class HttpMethodMatcher : MockHttp.Matchers.ValueMatcher<System.Net.Http.HttpMethod>
{
public HttpMethodMatcher(System.Net.Http.HttpMethod method) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public abstract class HttpRequestMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher
{
protected HttpRequestMatcher() { }
public virtual bool IsExclusive { get; }
public abstract bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext);
public System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public abstract override string ToString() { }
}
public interface IAsyncHttpRequestMatcher
{
bool IsExclusive { get; }
System.Threading.Tasks.Task<bool> IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext);
}
public class MediaTypeHeaderMatcher : MockHttp.Matchers.ValueMatcher<System.Net.Http.Headers.MediaTypeHeaderValue>
{
public MediaTypeHeaderMatcher(System.Net.Http.Headers.MediaTypeHeaderValue headerValue) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public class PartialContentMatcher : MockHttp.Matchers.ContentMatcher
{
public PartialContentMatcher(byte[] content) { }
public PartialContentMatcher(string content, System.Text.Encoding? encoding) { }
public override bool IsExclusive { get; }
protected override bool IsMatch(byte[] requestContent) { }
public override string ToString() { }
}
public class QueryStringMatcher : MockHttp.Matchers.HttpRequestMatcher
{
public QueryStringMatcher(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, System.Collections.Generic.IEnumerable<string>>> parameters) { }
public QueryStringMatcher(string queryString) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
public abstract class ValueMatcher<T> : MockHttp.Matchers.HttpRequestMatcher
{
protected ValueMatcher(T value) { }
protected T Value { get; }
}
public class VersionMatcher : MockHttp.Matchers.ValueMatcher<System.Version>
{
public VersionMatcher(System.Version version) { }
public override bool IsExclusive { get; }
public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { }
public override string ToString() { }
}
}
namespace MockHttp.Responses
{
Expand Down
Loading

0 comments on commit 10cc171

Please sign in to comment.