mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-23 01:04:55 +01:00
ct
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace WireMock.Net.Testcontainers.Utils;
|
||||
|
||||
internal static class CombineUtils
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if !(NET452 || NET461 || NETCOREAPP3_1)
|
||||
using System.Threading.Tasks;
|
||||
using RestEase;
|
||||
using VerifyXunit;
|
||||
using WireMock.Client;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.RequestBuilders;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Server;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.AdminApi;
|
||||
|
||||
@@ -149,5 +145,4 @@ message HelloReply {
|
||||
|
||||
return server;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if !(NET452 || NET461 || NETCOREAPP3_1)
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
@@ -16,7 +12,6 @@ using WireMock.Client;
|
||||
using WireMock.Constants;
|
||||
using WireMock.Models;
|
||||
using WireMock.Server;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.AdminApi;
|
||||
|
||||
@@ -37,17 +32,18 @@ public partial class WireMockAdminApiTests
|
||||
public async Task HttpClient_PostMappingsAsync_ForProtoBufMapping(string mappingFile, string guid)
|
||||
{
|
||||
// Arrange
|
||||
var cancelationToken = TestContext.Current.CancellationToken;
|
||||
var mappingsJson = ReadMappingFile(mappingFile);
|
||||
|
||||
using var server = WireMockServer.StartWithAdminInterface();
|
||||
var httpClient = server.CreateClient();
|
||||
|
||||
// Act
|
||||
var result = await httpClient.PostAsync("/__admin/mappings", new StringContent(mappingsJson, Encoding.UTF8, WireMockConstants.ContentTypeJson));
|
||||
var result = await httpClient.PostAsync("/__admin/mappings", new StringContent(mappingsJson, Encoding.UTF8, WireMockConstants.ContentTypeJson), cancelationToken);
|
||||
result.EnsureSuccessStatusCode();
|
||||
|
||||
// Assert
|
||||
var mapping = await httpClient.GetStringAsync($"/__admin/mappings/{guid}");
|
||||
var mapping = await httpClient.GetStringAsync($"/__admin/mappings/{guid}", cancelationToken);
|
||||
mapping = RemoveLineContainingUpdatedAt(mapping);
|
||||
mapping.Should().Be(mappingsJson);
|
||||
}
|
||||
@@ -174,5 +170,4 @@ public partial class WireMockAdminApiTests
|
||||
|
||||
server.Stop();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
using System.Collections;
|
||||
using FluentAssertions;
|
||||
using WireMock.Extensions;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Extensions;
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using WireMock.Extensions;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Extensions;
|
||||
|
||||
|
||||
87
test/WireMock.Net.Tests/Extensions/HttpClientExtensions.cs
Normal file
87
test/WireMock.Net.Tests/Extensions/HttpClientExtensions.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if !NET5_0_OR_GREATER
|
||||
namespace System.Net.Http;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for HttpClient to provide CancellationToken support in frameworks before .NET 5.0.
|
||||
/// </summary>
|
||||
internal static class HttpClientExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends a GET request to the specified Uri as an asynchronous operation.
|
||||
/// This extension is only used in frameworks prior to .NET 5.0 where CancellationToken is not supported.
|
||||
/// </summary>
|
||||
public static Task<HttpResponseMessage> GetAsync(this HttpClient client, Uri requestUri, CancellationToken _)
|
||||
{
|
||||
// In older frameworks, we ignore the cancellation token since it's not supported
|
||||
return client.GetAsync(requestUri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a GET request to the specified Uri and return the response body as a string.
|
||||
/// This extension is only used in frameworks prior to .NET 5.0 where CancellationToken is not supported.
|
||||
/// </summary>
|
||||
public static Task<string> GetStringAsync(this HttpClient client, string requestUri, CancellationToken _)
|
||||
{
|
||||
// In older frameworks, we ignore the cancellation token since it's not supported
|
||||
return client.GetStringAsync(requestUri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a GET request to the specified Uri and return the response body as a string.
|
||||
/// This extension is only used in frameworks prior to .NET 5.0 where CancellationToken is not supported.
|
||||
/// </summary>
|
||||
public static Task<string> GetStringAsync(this HttpClient client, Uri requestUri, CancellationToken _)
|
||||
{
|
||||
// In older frameworks, we ignore the cancellation token since it's not supported
|
||||
return client.GetStringAsync(requestUri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a POST request to the specified Uri as an asynchronous operation.
|
||||
/// This extension is only used in frameworks prior to .NET 5.0 where CancellationToken is not supported.
|
||||
/// </summary>
|
||||
public static Task<HttpResponseMessage> PostAsync(this HttpClient client, string requestUri, HttpContent content, CancellationToken _)
|
||||
{
|
||||
// In older frameworks, we ignore the cancellation token since it's not supported
|
||||
return client.PostAsync(requestUri, content);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a POST request to the specified Uri as an asynchronous operation.
|
||||
/// This extension is only used in frameworks prior to .NET 5.0 where CancellationToken is not supported.
|
||||
/// </summary>
|
||||
public static Task<HttpResponseMessage> PostAsync(this HttpClient client, Uri requestUri, HttpContent content, CancellationToken _)
|
||||
{
|
||||
// In older frameworks, we ignore the cancellation token since it's not supported
|
||||
return client.PostAsync(requestUri, content);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends an HTTP request as an asynchronous operation.
|
||||
/// This extension is only used in frameworks prior to .NET 5.0 where CancellationToken is not supported.
|
||||
/// </summary>
|
||||
public static Task<HttpResponseMessage> SendAsync(this HttpClient client, HttpRequestMessage request, CancellationToken _)
|
||||
{
|
||||
// In older frameworks, we ignore the cancellation token since it's not supported
|
||||
return client.SendAsync(request);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for HttpContent to provide CancellationToken support in frameworks before .NET 5.0.
|
||||
/// </summary>
|
||||
internal static class HttpContentExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Serialize the HTTP content to a string as an asynchronous operation.
|
||||
/// This extension is only used in frameworks prior to .NET 5.0 where CancellationToken is not supported.
|
||||
/// </summary>
|
||||
public static Task<string> ReadAsStringAsync(this HttpContent content, CancellationToken _)
|
||||
{
|
||||
// In older frameworks, we ignore the cancellation token since it's not supported
|
||||
return content.ReadAsStringAsync();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Facts;
|
||||
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
// Copyright © WireMock.Net
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using WireMock.Net.Testcontainers.Utils;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Facts;
|
||||
|
||||
[ExcludeFromCodeCoverage]
|
||||
public sealed class RunOnDockerPlatformFact : FactAttribute
|
||||
{
|
||||
public RunOnDockerPlatformFact(string platform)
|
||||
public RunOnDockerPlatformFact(string platform,
|
||||
[CallerFilePath] string? sourceFilePath = null,
|
||||
[CallerLineNumber] int sourceLineNumber = -1) : base(sourceFilePath, sourceLineNumber)
|
||||
{
|
||||
if (TestcontainersUtils.GetImageOSAsync.Value.Result != OSPlatform.Create(platform))
|
||||
{
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using FluentAssertions.Execution;
|
||||
using WireMock.FluentAssertions;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http.Json;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using WireMock.FluentAssertions;
|
||||
using WireMock.Matchers;
|
||||
@@ -14,7 +11,6 @@ using WireMock.RequestBuilders;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Server;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.FluentAssertions;
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using NFluent;
|
||||
using WireMock.Handlers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Handlers;
|
||||
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using WireMock.Http;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Http;
|
||||
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.Http;
|
||||
using WireMock.Models;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Http;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
using System.Net.Http.Headers;
|
||||
using FluentAssertions;
|
||||
using WireMock.Http;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Http;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if !(NET452 || NET461 || NETCOREAPP3_1)
|
||||
using System.Net;
|
||||
using Moq;
|
||||
using WireMock.Handlers;
|
||||
@@ -253,5 +252,4 @@ public class MappingBuilderTests
|
||||
_fileSystemHandlerMock.Verify(fs => fs.WriteMappingFile(It.IsAny<string>(), It.IsAny<string>()), Times.Exactly(_numMappings));
|
||||
_fileSystemHandlerMock.VerifyNoOtherCalls();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using AnyOfTypes;
|
||||
using FluentAssertions;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ using FluentAssertions;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using FluentAssertions;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
using NFluent;
|
||||
using WireMock.Admin.Mappings;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Matchers;
|
||||
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NFluent;
|
||||
@@ -16,7 +11,6 @@ using WireMock.RequestBuilders;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Server;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests;
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if !(NET452 || NET461 || NETCOREAPP3_1)
|
||||
using FluentAssertions;
|
||||
using WireMock.Net.OpenApiParser.Utils;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.OpenApiParser;
|
||||
|
||||
@@ -36,5 +34,4 @@ public class PathUtilsTests
|
||||
// Assert
|
||||
result.Should().Be("/path1/path2");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using WireMock.OpenTelemetry;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.OpenTelemetry;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
@@ -10,7 +9,6 @@ using WireMock.Models;
|
||||
using WireMock.Owin.ActivityTracing;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Owin.ActivityTracing;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using WireMock.Owin;
|
||||
using WireMock.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Owin;
|
||||
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Xunit;
|
||||
using Moq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using FluentAssertions;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Owin.Mappers;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
@@ -9,7 +8,6 @@ using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
using WireMock.Owin;
|
||||
using WireMock.Services;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Owin;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ using WireMock.Handlers;
|
||||
using WireMock.Proxy;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Proxy;
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using NFluent;
|
||||
using WireMock.RegularExpressions;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RegularExpressions;
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using NFluent;
|
||||
using System.Collections.Generic;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
using WireMock.Owin;
|
||||
using WireMock.RequestBuilders;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestBuilders;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NFluent;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.RequestBuilders;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestBuilders;
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using Newtonsoft.Json;
|
||||
@@ -14,7 +11,6 @@ using WireMock.Models;
|
||||
using WireMock.RequestBuilders;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestBuilders;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
using WireMock.RequestBuilders;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestBuilders;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.RequestBuilders;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestBuilders;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.RequestBuilders;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestBuilders;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.RequestBuilders;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestBuilders;
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using Xunit;
|
||||
using WireMock.RequestBuilders;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.RequestBuilders;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestBuilders;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.RequestBuilders;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestBuilders;
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NFluent;
|
||||
@@ -13,7 +9,6 @@ using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestMatchers;
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Moq;
|
||||
using NFluent;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestMatchers;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestMatchers;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NFluent;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestMatchers;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ using FluentAssertions;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestMatchers;
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ using WireMock.Matchers.Request;
|
||||
using WireMock.Models;
|
||||
using WireMock.Owin;
|
||||
using WireMock.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.RequestMatchers;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
using NFluent;
|
||||
using WireMock.Models;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests;
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using NFluent;
|
||||
using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using WireMock.RequestBuilders;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Server;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders
|
||||
{
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
@@ -15,7 +12,6 @@ using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
@@ -11,7 +9,6 @@ using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using HandlebarsDotNet;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@@ -13,7 +11,6 @@ using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using NFluent;
|
||||
@@ -10,7 +9,6 @@ using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -10,7 +8,6 @@ using WireMock.Handlers;
|
||||
using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
@@ -15,7 +13,6 @@ using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using HandlebarsDotNet;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@@ -14,7 +12,6 @@ using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
@@ -11,7 +9,6 @@ using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using NFluent;
|
||||
@@ -11,7 +9,6 @@ using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -4,12 +4,10 @@ using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NFluent;
|
||||
using System.Threading.Tasks;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using NFluent;
|
||||
@@ -9,7 +7,6 @@ using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using NFluent;
|
||||
@@ -14,7 +11,6 @@ using WireMock.Server;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.Models;
|
||||
@@ -9,7 +7,6 @@ using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
using WireMock.Handlers;
|
||||
using Moq;
|
||||
#if NET452
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilders;
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using AnyOfTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WireMock.Net.Tests.Serialization
|
||||
{
|
||||
public class CustomPathParamMatcherModel
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using Moq;
|
||||
using WireMock.Serialization;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Serialization;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using JsonConverter.Newtonsoft.Json;
|
||||
using WireMock.Admin.Mappings;
|
||||
using WireMock.Serialization;
|
||||
using Xunit;
|
||||
#if NET8_0_OR_GREATER
|
||||
using JsonConverter.System.Text.Json;
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using HandlebarsDotNet;
|
||||
using HandlebarsDotNet.Helpers.Enums;
|
||||
@@ -12,7 +9,6 @@ using WireMock.Handlers;
|
||||
using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Settings;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Settings;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
using FluentAssertions;
|
||||
using WireMock.Settings;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Settings;
|
||||
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.RequestBuilders;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Server;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests;
|
||||
|
||||
@@ -294,6 +290,7 @@ public class StatefulBehaviorTests
|
||||
public async Task Scenarios_TodoList_Example()
|
||||
{
|
||||
// Arrange
|
||||
var cancelationToken = TestContext.Current.CancellationToken;
|
||||
var server = WireMockServer.Start();
|
||||
var client = server.CreateClient();
|
||||
|
||||
@@ -319,7 +316,7 @@ public class StatefulBehaviorTests
|
||||
Check.That(server.Scenarios.Any()).IsFalse();
|
||||
|
||||
// Act and Assert
|
||||
var getResponse1 = await client.GetStringAsync("/todo/items");
|
||||
var getResponse1 = await client.GetStringAsync("/todo/items", cancelationToken);
|
||||
Check.That(getResponse1).Equals("Buy milk");
|
||||
|
||||
Check.That(server.Scenarios["To do list"].Name).IsEqualTo("To do list");
|
||||
@@ -327,7 +324,7 @@ public class StatefulBehaviorTests
|
||||
Check.That(server.Scenarios["To do list"].Started).IsTrue();
|
||||
Check.That(server.Scenarios["To do list"].Finished).IsFalse();
|
||||
|
||||
var postResponse = await client.PostAsync("/todo/items", new StringContent("Cancel newspaper subscription"));
|
||||
var postResponse = await client.PostAsync("/todo/items", new StringContent("Cancel newspaper subscription"), cancelationToken);
|
||||
Check.That(postResponse.StatusCode).Equals(HttpStatusCode.Created);
|
||||
|
||||
Check.That(server.Scenarios["To do list"].Name).IsEqualTo("To do list");
|
||||
@@ -335,7 +332,7 @@ public class StatefulBehaviorTests
|
||||
Check.That(server.Scenarios["To do list"].Started).IsTrue();
|
||||
Check.That(server.Scenarios["To do list"].Finished).IsFalse();
|
||||
|
||||
string getResponse2 = await client.GetStringAsync("/todo/items");
|
||||
string getResponse2 = await client.GetStringAsync("/todo/items", cancelationToken);
|
||||
Check.That(getResponse2).Equals("Buy milk;Cancel newspaper subscription");
|
||||
|
||||
Check.That(server.Scenarios["To do list"].Name).IsEqualTo("To do list");
|
||||
@@ -350,6 +347,7 @@ public class StatefulBehaviorTests
|
||||
public async Task Scenarios_TodoList_WithSetState()
|
||||
{
|
||||
// Arrange
|
||||
var cancelationToken = TestContext.Current.CancellationToken;
|
||||
var scenario = "To do list";
|
||||
using var server = WireMockServer.Start();
|
||||
var client = server.CreateClient();
|
||||
@@ -370,14 +368,14 @@ public class StatefulBehaviorTests
|
||||
server.SetScenarioState(scenario, "Buy milk");
|
||||
server.Scenarios[scenario].Should().BeEquivalentTo(new { Name = scenario, NextState = "Buy milk" });
|
||||
|
||||
var getResponse1 = await client.GetStringAsync("/todo/items");
|
||||
var getResponse1 = await client.GetStringAsync("/todo/items", cancelationToken);
|
||||
getResponse1.Should().Be("Buy milk");
|
||||
|
||||
server.SetScenarioState(scenario, "Cancel newspaper");
|
||||
server.Scenarios[scenario].Name.Should().Be(scenario);
|
||||
server.Scenarios[scenario].Should().BeEquivalentTo(new { Name = scenario, NextState = "Cancel newspaper" });
|
||||
|
||||
var getResponse2 = await client.GetStringAsync("/todo/items");
|
||||
var getResponse2 = await client.GetStringAsync("/todo/items", cancelationToken);
|
||||
getResponse2.Should().Be("Buy milk;Cancel newspaper subscription");
|
||||
}
|
||||
|
||||
@@ -413,6 +411,7 @@ public class StatefulBehaviorTests
|
||||
public async Task Scenarios_Should_process_request_if_equals_state_and_multiple_state_defined()
|
||||
{
|
||||
// Assign
|
||||
var cancelationToken = TestContext.Current.CancellationToken;
|
||||
var server = WireMockServer.Start();
|
||||
|
||||
server
|
||||
@@ -441,16 +440,16 @@ public class StatefulBehaviorTests
|
||||
|
||||
// Act and Assert
|
||||
string url = "http://localhost:" + server.Ports[0];
|
||||
var responseNoState1 = await new HttpClient().GetStringAsync(url + "/state1");
|
||||
var responseNoState1 = await new HttpClient().GetStringAsync(url + "/state1", cancelationToken);
|
||||
Check.That(responseNoState1).Equals("No state msg 1");
|
||||
|
||||
var responseNoState2 = await new HttpClient().GetStringAsync(url + "/state2");
|
||||
var responseNoState2 = await new HttpClient().GetStringAsync(url + "/state2", cancelationToken);
|
||||
Check.That(responseNoState2).Equals("No state msg 2");
|
||||
|
||||
var responseWithState1 = await new HttpClient().GetStringAsync(url + "/foo1X");
|
||||
var responseWithState1 = await new HttpClient().GetStringAsync(url + "/foo1X", cancelationToken);
|
||||
Check.That(responseWithState1).Equals("Test state msg 1");
|
||||
|
||||
var responseWithState2 = await new HttpClient().GetStringAsync(url + "/foo2X");
|
||||
var responseWithState2 = await new HttpClient().GetStringAsync(url + "/foo2X", cancelationToken);
|
||||
Check.That(responseWithState2).Equals("Test state msg 2");
|
||||
|
||||
server.Stop();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace WireMock.Net.Tests;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using WireMock.Net.Testcontainers.Utils;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Testcontainers;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ using Moq;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Transformers.Handlebars;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Transformers.Handlebars;
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Transformers.Scriban;
|
||||
using WireMock.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Transformers.Scriban
|
||||
{
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using NFluent;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
using FluentAssertions;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using RandomDataGenerator.FieldOptions;
|
||||
using RandomDataGenerator.Randomizers;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using System;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using NFluent;
|
||||
using System.IO;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using FluentAssertions;
|
||||
using System;
|
||||
using System.Net;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using FluentAssertions;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
using FluentAssertions;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using FluentAssertions;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
using FluentAssertions;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user