mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-24 02:12:02 +01:00
xunit v3
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using Stef.Validation;
|
||||
|
||||
@@ -10,9 +8,7 @@ namespace WireMock.RegularExpressions;
|
||||
/// <summary>
|
||||
/// Extension to the <see cref="Regex"/> object, adding support for GUID tokens for matching on.
|
||||
/// </summary>
|
||||
//#if !NETSTANDARD1_3
|
||||
[Serializable]
|
||||
//#endif
|
||||
internal class RegexExtended : Regex
|
||||
{
|
||||
/// <inheritdoc cref="Regex"/>
|
||||
|
||||
@@ -148,7 +148,6 @@ public class WireMockServerSettings
|
||||
[JsonIgnore]
|
||||
public Action<object>? PostWireMockMiddlewareInit { get; set; }
|
||||
|
||||
//#if USE_ASPNETCORE
|
||||
/// <summary>
|
||||
/// Action which is called with IServiceCollection when ASP.NET Core DI is being configured. [Optional]
|
||||
/// </summary>
|
||||
@@ -161,7 +160,6 @@ public class WireMockServerSettings
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public CorsPolicyOptions? CorsPolicyOptions { get; set; }
|
||||
//#endif
|
||||
|
||||
/// <summary>
|
||||
/// The IWireMockLogger which logs Debug, Info, Warning or Error
|
||||
@@ -246,7 +244,6 @@ public class WireMockServerSettings
|
||||
[PublicAPI]
|
||||
public bool CustomCertificateDefined => CertificateSettings?.IsDefined == true;
|
||||
|
||||
//#if USE_ASPNETCORE
|
||||
/// <summary>
|
||||
/// Client certificate mode for the server
|
||||
/// </summary>
|
||||
@@ -257,8 +254,7 @@ public class WireMockServerSettings
|
||||
/// Whether to accept any client certificate
|
||||
/// </summary>
|
||||
public bool AcceptAnyClientCertificate { get; set; }
|
||||
//#endif
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Defines the global IWebhookSettings to use.
|
||||
/// </summary>
|
||||
|
||||
@@ -22,10 +22,7 @@ internal static class CompressionUtils
|
||||
using var compressedStream = new MemoryStream();
|
||||
using var zipStream = Create(contentEncoding, compressedStream, CompressionMode.Compress);
|
||||
zipStream.Write(data, 0, data.Length);
|
||||
|
||||
//#if !NETSTANDARD1_3
|
||||
zipStream.Close();
|
||||
//#endif
|
||||
return compressedStream.ToArray();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Stef.Validation;
|
||||
|
||||
@@ -142,16 +140,13 @@ internal static class TypeLoader
|
||||
|
||||
private static bool TryFindTypeInDlls<TInterface>(string? implementationTypeFullName, [NotNullWhen(true)] out Type? pluginType) where TInterface : class
|
||||
{
|
||||
//#if NETSTANDARD1_3
|
||||
// var directoriesToSearch = new[] { AppContext.BaseDirectory };
|
||||
//#else
|
||||
var processDirectory = Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule?.FileName);
|
||||
var processDirectory = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule?.FileName);
|
||||
var assemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
var directoriesToSearch = new[] { processDirectory, assemblyDirectory }
|
||||
.Where(d => !string.IsNullOrEmpty(d))
|
||||
.Distinct()
|
||||
.ToArray();
|
||||
//#endif
|
||||
|
||||
foreach (var directory in directoriesToSearch)
|
||||
{
|
||||
foreach (var file in Directory.GetFiles(directory!, "*.dll"))
|
||||
|
||||
Reference in New Issue
Block a user