Use NuGet "Stef.Validation" (#707)

* Use NuGet "Stef.Validation"

* nuget

* .
This commit is contained in:
Stef Heyenrath
2021-12-30 10:44:50 +01:00
committed by GitHub
parent fd1f4968b4
commit e8e28c21a1
77 changed files with 267 additions and 421 deletions

View File

@@ -11,7 +11,7 @@ using Microsoft.Extensions.DependencyInjection;
using WireMock.Logging;
using WireMock.Owin.Mappers;
using WireMock.Util;
using WireMock.Validation;
using Stef.Validation;
namespace WireMock.Owin
{
@@ -35,8 +35,8 @@ namespace WireMock.Owin
public AspNetCoreSelfHost([NotNull] IWireMockMiddlewareOptions wireMockMiddlewareOptions, [NotNull] HostUrlOptions urlOptions)
{
Check.NotNull(wireMockMiddlewareOptions, nameof(wireMockMiddlewareOptions));
Check.NotNull(urlOptions, nameof(urlOptions));
Guard.NotNull(wireMockMiddlewareOptions, nameof(wireMockMiddlewareOptions));
Guard.NotNull(urlOptions, nameof(urlOptions));
_logger = wireMockMiddlewareOptions.Logger ?? new WireMockConsoleLogger();

View File

@@ -12,7 +12,7 @@ using IContext = Microsoft.AspNetCore.Http.HttpContext;
using Next = Microsoft.AspNetCore.Http.RequestDelegate;
#endif
using WireMock.Owin.Mappers;
using WireMock.Validation;
using Stef.Validation;
namespace WireMock.Owin
{
@@ -24,8 +24,8 @@ namespace WireMock.Owin
#if !USE_ASPNETCORE
public GlobalExceptionMiddleware(Next next, IWireMockMiddlewareOptions options, IOwinResponseMapper responseMapper) : base(next)
{
Check.NotNull(options, nameof(options));
Check.NotNull(responseMapper, nameof(responseMapper));
Guard.NotNull(options, nameof(options));
Guard.NotNull(responseMapper, nameof(responseMapper));
_options = options;
_responseMapper = responseMapper;
@@ -33,8 +33,8 @@ namespace WireMock.Owin
#else
public GlobalExceptionMiddleware(Next next, IWireMockMiddlewareOptions options, IOwinResponseMapper responseMapper)
{
Check.NotNull(options, nameof(options));
Check.NotNull(responseMapper, nameof(responseMapper));
Guard.NotNull(options, nameof(options));
Guard.NotNull(responseMapper, nameof(responseMapper));
Next = next;
_options = options;

View File

@@ -12,7 +12,7 @@ using RandomDataGenerator.Randomizers;
using WireMock.Http;
using WireMock.ResponseBuilders;
using WireMock.Types;
using WireMock.Validation;
using Stef.Validation;
#if !USE_ASPNETCORE
using IResponse = Microsoft.Owin.IOwinResponse;
#else
@@ -47,7 +47,7 @@ namespace WireMock.Owin.Mappers
/// <param name="options">The IWireMockMiddlewareOptions.</param>
public OwinResponseMapper(IWireMockMiddlewareOptions options)
{
Check.NotNull(options, nameof(options));
Guard.NotNull(options, nameof(options));
_options = options;
}

View File

@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using WireMock.Extensions;
using WireMock.Validation;
using Stef.Validation;
namespace WireMock.Owin
{
@@ -12,7 +12,7 @@ namespace WireMock.Owin
public MappingMatcher(IWireMockMiddlewareOptions options)
{
Check.NotNull(options, nameof(options));
Guard.NotNull(options, nameof(options));
_options = options;
}

View File

@@ -8,7 +8,7 @@ using System.Threading;
using System.Threading.Tasks;
using WireMock.Logging;
using WireMock.Owin.Mappers;
using WireMock.Validation;
using Stef.Validation;
namespace WireMock.Owin
{
@@ -22,8 +22,8 @@ namespace WireMock.Owin
public OwinSelfHost([NotNull] IWireMockMiddlewareOptions options, [NotNull] HostUrlOptions urlOptions)
{
Check.NotNull(options, nameof(options));
Check.NotNull(urlOptions, nameof(urlOptions));
Guard.NotNull(options, nameof(options));
Guard.NotNull(urlOptions, nameof(urlOptions));
_options = options;
_logger = options.Logger ?? new WireMockConsoleLogger();

View File

@@ -7,7 +7,7 @@ using WireMock.Http;
using WireMock.Owin.Mappers;
using WireMock.Serialization;
using WireMock.Types;
using WireMock.Validation;
using Stef.Validation;
using WireMock.ResponseBuilders;
using WireMock.Settings;
#if !USE_ASPNETCORE
@@ -35,18 +35,18 @@ namespace WireMock.Owin
#if !USE_ASPNETCORE
public WireMockMiddleware(Next next, IWireMockMiddlewareOptions options, IOwinRequestMapper requestMapper, IOwinResponseMapper responseMapper, IMappingMatcher mappingMatcher) : base(next)
{
_options = Check.NotNull(options, nameof(options));
_requestMapper = Check.NotNull(requestMapper, nameof(requestMapper));
_responseMapper = Check.NotNull(responseMapper, nameof(responseMapper));
_mappingMatcher = Check.NotNull(mappingMatcher, nameof(mappingMatcher));
_options = Guard.NotNull(options, nameof(options));
_requestMapper = Guard.NotNull(requestMapper, nameof(requestMapper));
_responseMapper = Guard.NotNull(responseMapper, nameof(responseMapper));
_mappingMatcher = Guard.NotNull(mappingMatcher, nameof(mappingMatcher));
}
#else
public WireMockMiddleware(Next next, IWireMockMiddlewareOptions options, IOwinRequestMapper requestMapper, IOwinResponseMapper responseMapper, IMappingMatcher mappingMatcher)
{
_options = Check.NotNull(options, nameof(options));
_requestMapper = Check.NotNull(requestMapper, nameof(requestMapper));
_responseMapper = Check.NotNull(responseMapper, nameof(responseMapper));
_mappingMatcher = Check.NotNull(mappingMatcher, nameof(mappingMatcher));
_options = Guard.NotNull(options, nameof(options));
_requestMapper = Guard.NotNull(requestMapper, nameof(requestMapper));
_responseMapper = Guard.NotNull(responseMapper, nameof(responseMapper));
_mappingMatcher = Guard.NotNull(mappingMatcher, nameof(mappingMatcher));
}
#endif