mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-27 03:21:04 +01:00
Use NuGet "Stef.Validation" (#707)
* Use NuGet "Stef.Validation" * nuget * .
This commit is contained in:
@@ -8,7 +8,7 @@ using JetBrains.Annotations;
|
||||
using WireMock.Http;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Types;
|
||||
using WireMock.Validation;
|
||||
using Stef.Validation;
|
||||
|
||||
namespace WireMock.Util
|
||||
{
|
||||
@@ -109,7 +109,7 @@ namespace WireMock.Util
|
||||
|
||||
public static async Task<BodyData> ParseAsync([NotNull] BodyParserSettings settings)
|
||||
{
|
||||
Check.NotNull(settings, nameof(settings));
|
||||
Guard.NotNull(settings, nameof(settings));
|
||||
|
||||
var bodyWithContentEncoding = await ReadBytesAsync(settings.Stream, settings.ContentEncoding, settings.DecompressGZipAndDeflate).ConfigureAwait(false);
|
||||
var data = new BodyData
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
using WireMock.Validation;
|
||||
using Stef.Validation;
|
||||
|
||||
namespace WireMock.Util
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace WireMock.Util
|
||||
/// <param name="action">The action.</param>
|
||||
public static void Loop<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, [NotNull] Action<TKey, TValue> action)
|
||||
{
|
||||
Check.NotNull(action, nameof(action));
|
||||
Guard.NotNull(action, nameof(action));
|
||||
|
||||
if (dictionary != null)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.IO;
|
||||
using JetBrains.Annotations;
|
||||
using WireMock.Validation;
|
||||
using Stef.Validation;
|
||||
|
||||
namespace WireMock.Util
|
||||
{
|
||||
@@ -58,7 +58,7 @@ namespace WireMock.Util
|
||||
/// <param name="interval">The interval.</param>
|
||||
public EnhancedFileSystemWatcher(int interval = DefaultWatchInterval)
|
||||
{
|
||||
Check.Condition(interval, i => i >= 0, nameof(interval));
|
||||
Guard.Condition(interval, i => i >= 0, nameof(interval));
|
||||
|
||||
InitializeMembers(interval);
|
||||
}
|
||||
@@ -70,8 +70,8 @@ namespace WireMock.Util
|
||||
/// <param name="interval">The interval.</param>
|
||||
public EnhancedFileSystemWatcher([NotNull] string path, int interval = DefaultWatchInterval) : base(path)
|
||||
{
|
||||
Check.NotNullOrEmpty(path, nameof(path));
|
||||
Check.Condition(interval, i => i >= 0, nameof(interval));
|
||||
Guard.NotNullOrEmpty(path, nameof(path));
|
||||
Guard.Condition(interval, i => i >= 0, nameof(interval));
|
||||
|
||||
InitializeMembers(interval);
|
||||
}
|
||||
@@ -84,9 +84,9 @@ namespace WireMock.Util
|
||||
/// <param name="interval">The interval.</param>
|
||||
public EnhancedFileSystemWatcher([NotNull] string path, [NotNull] string filter, int interval = DefaultWatchInterval) : base(path, filter)
|
||||
{
|
||||
Check.NotNullOrEmpty(path, nameof(path));
|
||||
Check.NotNullOrEmpty(filter, nameof(filter));
|
||||
Check.Condition(interval, i => i >= 0, nameof(interval));
|
||||
Guard.NotNullOrEmpty(path, nameof(path));
|
||||
Guard.NotNullOrEmpty(filter, nameof(filter));
|
||||
Guard.Condition(interval, i => i >= 0, nameof(interval));
|
||||
|
||||
InitializeMembers(interval);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using JetBrains.Annotations;
|
||||
using System.Threading;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Validation;
|
||||
using Stef.Validation;
|
||||
|
||||
namespace WireMock.Util
|
||||
{
|
||||
@@ -12,8 +12,8 @@ namespace WireMock.Util
|
||||
|
||||
public static bool TryReadMappingFileWithRetryAndDelay([NotNull] IFileSystemHandler handler, [NotNull] string path, out string value)
|
||||
{
|
||||
Check.NotNull(handler, nameof(handler));
|
||||
Check.NotNullOrEmpty(path, nameof(path));
|
||||
Guard.NotNull(handler, nameof(handler));
|
||||
Guard.NotNullOrEmpty(path, nameof(path));
|
||||
|
||||
value = null;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using WireMock.Models;
|
||||
using WireMock.Validation;
|
||||
using Stef.Validation;
|
||||
#if !USE_ASPNETCORE
|
||||
using Microsoft.Owin;
|
||||
#else
|
||||
@@ -14,7 +14,7 @@ namespace WireMock.Util
|
||||
{
|
||||
public static UrlDetails Parse([NotNull] Uri uri, PathString pathBase)
|
||||
{
|
||||
Check.NotNull(uri, nameof(uri));
|
||||
Guard.NotNull(uri, nameof(uri));
|
||||
|
||||
if (!pathBase.HasValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user