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

@@ -9,7 +9,7 @@ using WireMock.ResponseProviders;
using WireMock.Settings;
using WireMock.Types;
using WireMock.Util;
using WireMock.Validation;
using Stef.Validation;
namespace WireMock.Server
{
@@ -154,7 +154,7 @@ namespace WireMock.Server
/// <inheritdoc />
public IRespondWithAProvider WithTimeSettings(ITimeSettings timeSettings)
{
Check.NotNull(timeSettings, nameof(timeSettings));
Guard.NotNull(timeSettings, nameof(timeSettings));
TimeSettings = timeSettings;
@@ -164,7 +164,7 @@ namespace WireMock.Server
/// <see cref="IRespondWithAProvider.WithWebhook(IWebhook[])"/>
public IRespondWithAProvider WithWebhook(params IWebhook[] webhooks)
{
Check.HasNoNulls(webhooks, nameof(webhooks));
Guard.HasNoNulls(webhooks, nameof(webhooks));
Webhooks = webhooks;

View File

@@ -24,7 +24,7 @@ using WireMock.Serialization;
using WireMock.Settings;
using WireMock.Types;
using WireMock.Util;
using WireMock.Validation;
using Stef.Validation;
namespace WireMock.Server
{
@@ -206,7 +206,7 @@ namespace WireMock.Server
[PublicAPI]
public bool ReadStaticMappingAndAddOrUpdate([NotNull] string path)
{
Check.NotNull(path, nameof(path));
Guard.NotNull(path, nameof(path));
string filenameWithoutExtension = Path.GetFileNameWithoutExtension(path);
@@ -414,9 +414,9 @@ namespace WireMock.Server
private Guid? ConvertMappingAndRegisterAsRespondProvider(MappingModel mappingModel, Guid? guid = null, string path = null)
{
Check.NotNull(mappingModel, nameof(mappingModel));
Check.NotNull(mappingModel.Request, nameof(mappingModel.Request));
Check.NotNull(mappingModel.Response, nameof(mappingModel.Response));
Guard.NotNull(mappingModel, nameof(mappingModel));
Guard.NotNull(mappingModel.Request, nameof(mappingModel.Request));
Guard.NotNull(mappingModel.Response, nameof(mappingModel.Response));
var requestBuilder = InitRequestBuilder(mappingModel.Request, true);
if (requestBuilder == null)

View File

@@ -9,7 +9,7 @@ using WireMock.Matchers;
using WireMock.RequestBuilders;
using WireMock.ResponseBuilders;
using WireMock.Util;
using WireMock.Validation;
using Stef.Validation;
using OrgMapping = WireMock.Org.Abstractions.Mapping;
namespace WireMock.Server
@@ -23,7 +23,7 @@ namespace WireMock.Server
[PublicAPI]
public void ReadStaticWireMockOrgMappingAndAddOrUpdate([NotNull] string path)
{
Check.NotNull(path, nameof(path));
Guard.NotNull(path, nameof(path));
string filenameWithoutExtension = Path.GetFileNameWithoutExtension(path);

View File

@@ -18,7 +18,7 @@ using WireMock.RequestBuilders;
using WireMock.ResponseProviders;
using WireMock.Serialization;
using WireMock.Settings;
using WireMock.Validation;
using Stef.Validation;
namespace WireMock.Server
{
@@ -93,7 +93,7 @@ namespace WireMock.Server
[PublicAPI]
public static WireMockServer Start([NotNull] IWireMockServerSettings settings)
{
Check.NotNull(settings, nameof(settings));
Guard.NotNull(settings, nameof(settings));
return new WireMockServer(settings);
}
@@ -122,7 +122,7 @@ namespace WireMock.Server
[PublicAPI]
public static WireMockServer Start(params string[] urls)
{
Check.NotNullOrEmpty(urls, nameof(urls));
Guard.NotNullOrEmpty(urls, nameof(urls));
return new WireMockServer(new WireMockServerSettings
{
@@ -155,7 +155,7 @@ namespace WireMock.Server
[PublicAPI]
public static WireMockServer StartWithAdminInterface(params string[] urls)
{
Check.NotNullOrEmpty(urls, nameof(urls));
Guard.NotNullOrEmpty(urls, nameof(urls));
return new WireMockServer(new WireMockServerSettings
{
@@ -172,7 +172,7 @@ namespace WireMock.Server
[PublicAPI]
public static WireMockServer StartWithAdminInterfaceAndReadStaticMappings(params string[] urls)
{
Check.NotNullOrEmpty(urls, nameof(urls));
Guard.NotNullOrEmpty(urls, nameof(urls));
return new WireMockServer(new WireMockServerSettings
{
@@ -413,8 +413,8 @@ namespace WireMock.Server
[PublicAPI]
public void SetAzureADAuthentication([NotNull] string tenant, [NotNull] string audience)
{
Check.NotNull(tenant, nameof(tenant));
Check.NotNull(audience, nameof(audience));
Guard.NotNull(tenant, nameof(tenant));
Guard.NotNull(audience, nameof(audience));
#if NETSTANDARD1_3
throw new NotSupportedException("AzureADAuthentication is not supported for NETStandard 1.3");
@@ -427,8 +427,8 @@ namespace WireMock.Server
[PublicAPI]
public void SetBasicAuthentication([NotNull] string username, [NotNull] string password)
{
Check.NotNull(username, nameof(username));
Check.NotNull(password, nameof(password));
Guard.NotNull(username, nameof(username));
Guard.NotNull(password, nameof(password));
_options.AuthenticationMatcher = new BasicAuthenticationMatcher(username, password);
}