Skip to content

Commit 4a0fd07

Browse files
committed
move to xunit v3
1 parent b8d920d commit 4a0fd07

61 files changed

Lines changed: 562 additions & 595 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<PackageVersion Include="CsvHelper" Version="33.1.0" />
55
<PackageVersion Include="AwesomeAssertions" Version="9.3.0" />
66
<PackageVersion Include="JetBrains.Profiler.Api" Version="1.4.10" />
7+
<PackageVersion Include="MartinCostello.Logging.XUnit.v3" Version="0.7.0" />
78
<PackageVersion Include="MessagePack" Version="2.5.198" />
89
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.0" />
910
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.0" />
@@ -33,9 +34,8 @@
3334
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />
3435
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="10.0.1" />
3536
<PackageVersion Include="System.Collections.Immutable" Version="10.0.0" />
36-
<PackageVersion Include="Verify.Xunit" Version="31.7.1" />
37-
<PackageVersion Include="xunit" Version="2.9.3" />
38-
<PackageVersion Include="Xunit.Extensions.Logging" Version="1.1.0" />
37+
<PackageVersion Include="Verify.XunitV3" Version="31.7.2" />
38+
<PackageVersion Include="xunit.v3" Version="3.2.0" />
3939
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
4040
</ItemGroup>
4141
</Project>

test/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<PackageReference Include="AwesomeAssertions" />
2525
<PackageReference Include="NSubstitute" />
2626
<PackageReference Include="NSubstitute.Analyzers.CSharp" />
27-
<PackageReference Include="Verify.Xunit" />
28-
<PackageReference Include="xunit" />
27+
<PackageReference Include="Verify.XunitV3" />
28+
<PackageReference Include="xunit.v3" />
2929
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
3030
</ItemGroup>
3131

test/Thinktecture.Runtime.Extensions.EntityFrameworkCore.Tests.Sources/EntityFrameworkCore/ValueConversion/ValueObjectValueConverterFactoryTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public async Task Should_write_and_read_enums_and_value_types()
5151
],
5252
};
5353
_ctx.Add(entity);
54-
await _ctx.SaveChangesAsync();
54+
await _ctx.SaveChangesAsync(TestContext.Current.CancellationToken);
5555

5656
_ctx.ChangeTracker.Clear();
57-
(await _ctx.TestEntities_with_Enum_and_ValueObjects.SingleAsync())
57+
(await _ctx.TestEntities_with_Enum_and_ValueObjects.SingleAsync(TestContext.Current.CancellationToken))
5858
.Should().BeEquivalentTo(entity);
5959
}
6060

@@ -70,7 +70,7 @@ public async Task Should_use_ctor_of_value_types_instead_of_factory_because_DB_i
7070
TestComplexValueObject_ObjectFactory_and_Constructor = TestComplexValueObject_ObjectFactory_and_Constructor.Create("value 3", "value 4"),
7171
};
7272
_ctx.Add(entity);
73-
await _ctx.SaveChangesAsync();
73+
await _ctx.SaveChangesAsync(TestContext.Current.CancellationToken);
7474

7575
await using var command = _ctx.Database.GetDbConnection().CreateCommand();
7676
command.CommandText = @"
@@ -80,10 +80,10 @@ UPDATE TestEntities_with_Enum_and_ValueObjects
8080
Boundary_Lower = 30,
8181
TestComplexValueObject_ObjectFactory_and_Constructor = ''
8282
";
83-
await command.ExecuteNonQueryAsync();
83+
await command.ExecuteNonQueryAsync(TestContext.Current.CancellationToken);
8484

8585
_ctx.ChangeTracker.Clear();
86-
var loadedEntity = await _ctx.TestEntities_with_Enum_and_ValueObjects.SingleAsync();
86+
var loadedEntity = await _ctx.TestEntities_with_Enum_and_ValueObjects.SingleAsync(TestContext.Current.CancellationToken);
8787
loadedEntity.StringBasedStructValueObject.Property.Should().Be(String.Empty);
8888
loadedEntity.Boundary.Lower.Should().Be(30);
8989
loadedEntity.Boundary.Upper.Should().Be(20);
@@ -117,7 +117,7 @@ await _ctx.TestEntities_with_Enum_and_ValueObjects
117117
&& e.IntBasedStructValueObject == nullableInt16
118118
&& e.IntBasedStructValueObject == deci
119119
&& e.IntBasedStructValueObject == nullableDecimal)
120-
.ToListAsync();
120+
.ToListAsync(TestContext.Current.CancellationToken);
121121
}
122122

123123
[Fact]
@@ -128,11 +128,11 @@ public async Task Should_roundtrip_complex_value_object_with_complex_property()
128128
new TestComplexType { TestEnum = SmartEnum_StringBased.Item1 });
129129

130130
_ctx.Add(entity);
131-
await _ctx.SaveChangesAsync();
131+
await _ctx.SaveChangesAsync(TestContext.Current.CancellationToken);
132132

133133
_ctx.ChangeTracker.Clear();
134134

135-
var loadedEntity = await _ctx.ComplexValueObject_with_ComplexType.SingleAsync();
135+
var loadedEntity = await _ctx.ComplexValueObject_with_ComplexType.SingleAsync(TestContext.Current.CancellationToken);
136136
loadedEntity.Id.Should().Be(entity.Id);
137137
loadedEntity.TestComplexType.Should().BeEquivalentTo(entity.TestComplexType);
138138
}

0 commit comments

Comments
 (0)