mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-17 23:57:03 +01:00
Update NuGet packages (#728)
* Update NuGet pacakges * . * . * 3 * FluentBuilder * 10000 * typo * f * . * net6 * fix build * t * t2 * net6 * . * <PackageReference Include="System.Text.Encodings.Web" Version="4.7.2" /> * . * ... * . * fix
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Linq.Dynamic.Core;
|
||||
using FluentAssertions;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NFluent;
|
||||
using System.Linq.Dynamic.Core;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
@@ -41,7 +42,28 @@ namespace WireMock.Net.Tests.Util
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JsonUtils_GenerateDynamicLinqStatement_JObject()
|
||||
public void JsonUtils_GenerateDynamicLinqStatement_JArray_Indexer()
|
||||
{
|
||||
// Assign
|
||||
var j = new JObject
|
||||
{
|
||||
{ "Items", new JArray(new[] { new JValue(4), new JValue(8) }) }
|
||||
};
|
||||
|
||||
// Act
|
||||
string line = JsonUtils.GenerateDynamicLinqStatement(j);
|
||||
|
||||
// Assert 1
|
||||
line.Should().Be("new ((new [] { long(Items[0]), long(Items[1])}) as Items)");
|
||||
|
||||
// Assert 2
|
||||
var queryable = new[] { j }.AsQueryable().Select(line);
|
||||
bool result = queryable.Any("Items != null");
|
||||
result.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JsonUtils_GenerateDynamicLinqStatement_JObject2()
|
||||
{
|
||||
// Assign
|
||||
var j = new JObject
|
||||
@@ -52,7 +74,6 @@ namespace WireMock.Net.Tests.Util
|
||||
{"Flt", new JValue(10.0f)},
|
||||
{"Dbl", new JValue(Math.PI)},
|
||||
{"Check", new JValue(true)},
|
||||
{"Items", new JArray(new[] { new JValue(4), new JValue(8) })},
|
||||
{
|
||||
"Child", new JObject
|
||||
{
|
||||
@@ -69,12 +90,13 @@ namespace WireMock.Net.Tests.Util
|
||||
// Act
|
||||
string line = JsonUtils.GenerateDynamicLinqStatement(j);
|
||||
|
||||
// Assert
|
||||
// Assert 1
|
||||
line.Should().Be("new (Uri(U) as U, null as N, Guid(G) as G, double(Flt) as Flt, double(Dbl) as Dbl, bool(Check) as Check, new (long(Child.ChildId) as ChildId, DateTime(Child.ChildDateTime) as ChildDateTime, TimeSpan(Child.TS) as TS) as Child, long(I) as I, long(L) as L, string(Name) as Name)");
|
||||
|
||||
// Assert 2
|
||||
var queryable = new[] { j }.AsQueryable().Select(line);
|
||||
bool result = queryable.Any("I > 1 && L > 1");
|
||||
Check.That(result).IsTrue();
|
||||
|
||||
Check.That(line).IsEqualTo("new (Uri(U) as U, null as N, Guid(G) as G, double(Flt) as Flt, double(Dbl) as Dbl, bool(Check) as Check, (new [] { long(Items[0]), long(Items[1])}) as Items, new (long(Child.ChildId) as ChildId, DateTime(Child.ChildDateTime) as ChildDateTime, TimeSpan(Child.TS) as TS) as Child, long(I) as I, long(L) as L, string(Name) as Name)");
|
||||
result.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<Authors>Stef Heyenrath</Authors>
|
||||
<TargetFrameworks>net452;net461;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<TargetFrameworks>net452;net461;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
|
||||
<IsPackable>false</IsPackable>
|
||||
<DebugType>full</DebugType>
|
||||
<AssemblyName>WireMock.Net.Tests</AssemblyName>
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Codecov" Version="1.13.0" />
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.0">
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
@@ -44,7 +44,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0">
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
@@ -59,9 +59,9 @@
|
||||
<!--<PackageReference Include="OpenCover" Version="4.7.922" />-->
|
||||
<!--<PackageReference Include="ReportGenerator" Version="4.8.1" />-->
|
||||
<PackageReference Include="SimMetrics.Net" Version="1.0.5" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.12" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.17" />
|
||||
<!--<PackageReference Include="StrongNamer" Version="0.2.5" />-->
|
||||
<PackageReference Include="AnyOf" Version="0.2.0" />
|
||||
<PackageReference Include="AnyOf" Version="0.3.0" />
|
||||
<!--<PackageReference Include="TinyMapper" Version="3.0.3" />-->
|
||||
</ItemGroup>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net452' and '$(TargetFramework)' != 'net461'">
|
||||
<PackageReference Include="FluentAssertions" Version="6.1.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net452'">
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace WireMock.Net.Tests
|
||||
server.Stop();
|
||||
}
|
||||
|
||||
#if NETCOREAPP3_1_OR_GREATER
|
||||
#if NETCOREAPP3_1 || NET5_0 || NET6_0
|
||||
[Fact]
|
||||
public async Task WireMockServer_WithCorsPolicyOptions_Should_Work_Correct()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user