This commit is contained in:
Stef Heyenrath
2026-02-14 11:41:25 +01:00
parent 99f42fb255
commit 6cc18e796c
55 changed files with 164 additions and 398 deletions

View File

@@ -1,21 +1,15 @@
// Copyright © WireMock.Net
using System.Threading.Tasks;
//using System.Xml;
using FluentAssertions;
using Microsoft.AspNetCore.Http;
using Moq;
using NFluent;
using WireMock.Handlers;
using WireMock.Models;
using WireMock.ResponseBuilders;
using WireMock.Settings;
using WireMock.Types;
using WireMock.Util;
using Xunit;
using Moq;
using WireMock.Handlers;
using FluentAssertions;
using Microsoft.AspNetCore.Http;
//#if !NETSTANDARD1_3
//using Wmhelp.XPath2;
//#endif
namespace WireMock.Net.Tests.ResponseBuilders;

View File

@@ -1,14 +1,9 @@
// Copyright © WireMock.Net
#if NET8_0_OR_GREATER
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@@ -22,8 +17,6 @@ using WireMock.RequestBuilders;
using WireMock.ResponseBuilders;
using WireMock.Server;
using WireMock.Settings;
using Xunit;
using Xunit.Abstractions;
namespace WireMock.Net.Tests.ResponseBuilders;
@@ -95,10 +88,10 @@ public sealed class ResponseWithProxyIntegrationTests(ITestOutputHelper output)
{
var started = new TaskCompletionSource();
var host = app.Services.GetRequiredService<IHostApplicationLifetime>();
host.ApplicationStarted.Register(() => started.SetResult());
host.ApplicationStarted.Register(started.SetResult);
_ = Task.Run(() => app.RunAsync());
await started.Task;
_disposable = new(() => host.StopApplication());
_disposable = new(host.StopApplication);
return this;
}

View File

@@ -1,10 +1,9 @@
// Copyright © WireMock.Net
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.AspNetCore.Http;
using Moq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -15,14 +14,6 @@ using WireMock.ResponseBuilders;
using WireMock.Settings;
using WireMock.Types;
using WireMock.Util;
using Xunit;
using System.Globalization;
using CultureAwareTesting.xUnit;
#if NET452
using Microsoft.Owin;
#else
using Microsoft.AspNetCore.Http;
#endif
namespace WireMock.Net.Tests.ResponseBuilders;
@@ -442,7 +433,7 @@ public class ResponseWithTransformerTests
Check.That(JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson)).Equals("{\"x\":\"test /foo_object\"}");
}
[CulturedTheory("en-US")]
[CulturedTheory(["en-US"])]
[InlineData(TransformerType.Handlebars, "{ \"id\": 42 }", "{\"x\":\"test 42\",\"y\":42}")]
[InlineData(TransformerType.Scriban, "{ \"id\": 42 }", "{\"x\":\"test 42\",\"y\":42}")]
[InlineData(TransformerType.ScribanDotLiquid, "{ \"id\": 42 }", "{\"x\":\"test 42\",\"y\":42}")]
@@ -779,7 +770,6 @@ public class ResponseWithTransformerTests
response.Message.BodyData.Encoding.Should().Be(enc);
}
//#if MIMEKIT
[Theory]
[InlineData(TransformerType.Handlebars)]
// [InlineData(TransformerType.Scriban)]
@@ -830,7 +820,6 @@ AAAADElEQVR4XmMQYNgAAADkAMHebX3mAAAAAElFTkSuQmCC
// Assert
response.Message.BodyData!.BodyAsString.Should().Be("text/plain text/json image.png");
}
//#endif
[Theory]
[InlineData("/wiremock-data/1", "one")]