Skip to content

Commit

Permalink
Merge pull request #439 from phnx47/test/xunit.v3
Browse files Browse the repository at this point in the history
upgrade to xunit v3
  • Loading branch information
phnx47 authored Jan 5, 2025
2 parents 12dbfc1 + b7d0026 commit ee7220a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
14 changes: 7 additions & 7 deletions tests/Repositories.Base/BaseRepositoriesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ public void FindById_MultiKeys()
}

[Fact]
public async void FindByIdAsync()
public async Task FindByIdAsync()
{
var user = await Db.Users.FindByIdAsync(2);
Assert.Null(user.Deleted);
Assert.Equal("TestName1", user.Name);
}

[Fact]
public async void FindByIdAsync_WithJoins_NotNull()
public async Task FindByIdAsync_WithJoins_NotNull()
{
var user = await Db.Users.FindByIdAsync<Car, Phone, Address>(1, x => x.Cars, x => x.Phone, x => x.Addresses);
Assert.Null(user.Deleted);
Expand All @@ -117,7 +117,7 @@ public async void FindByIdAsync_WithJoins_NotNull()
}

[Fact]
public async void FindByIdAsync_WithJoins_CheckCount()
public async Task FindByIdAsync_WithJoins_CheckCount()
{
var address = await Db.Address.FindByIdAsync<User>(1, x => x.Users);
Assert.Equal("Street0", address.Street);
Expand All @@ -126,7 +126,7 @@ public async void FindByIdAsync_WithJoins_CheckCount()
}

[Fact]
public async void FindAllAsync_WithPredicate_CheckCount()
public async Task FindAllAsync_WithPredicate_CheckCount()
{
var addresses = (await Db.Address.FindAllAsync<User>(q => q.Id == 1, x => x.Users)).ToArray();
Assert.Single(addresses);
Expand All @@ -137,7 +137,7 @@ public async void FindAllAsync_WithPredicate_CheckCount()
}

[Fact]
public async void FindAllAsync_NullPredicate_CheckCount()
public async Task FindAllAsync_NullPredicate_CheckCount()
{
var addresses = (await Db.Address.FindAllAsync<User>(null, x => x.Users)).ToArray();
var address = addresses.First();
Expand All @@ -157,7 +157,7 @@ protected void FindJoin_CollectionnRecord()
}

[Fact]
public async void FindJoinAsync_CollectionnRecord()
public async Task FindJoinAsync_CollectionnRecord()
{
var user = await Db.Users.FindAsync<Car>(q => q.Id == 1, q => q.Cars);
Assert.Null(user.Deleted);
Expand Down Expand Up @@ -281,7 +281,7 @@ public void FindAllJoinSameTableTwice()
}

[Fact]
public async void FindAllJoinSameTableTwiceAsync()
public async Task FindAllJoinSameTableTwiceAsync()
{
var user = (await Db.Users.FindAllAsync<Phone, Car, Phone>(x => x.Id == 1, q => q.OfficePhone, q => q.Cars, q => q.Phone)).First();
Assert.True(user.Cars.Count == 2);
Expand Down
2 changes: 1 addition & 1 deletion tests/Repositories.Base/Repositories.Base.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.v3" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.v3" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackageReference Include="MySql.Data" Version="9.1.0" />
<PackageReference Include="MySqlConnector" Version="2.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.v3" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ItemGroup>
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.v3" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ItemGroup>
<PackageReference Include="Npgsql" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.v3" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackageReference Include="System.Data.SQLite" Version="1.0.119" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.v3" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion tests/SqlGenerator.Tests/SqlGenerator.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.v3" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit ee7220a

Please sign in to comment.