Skip to content

Commit ca39416

Browse files
committed
Update to xUnit v3. Fixes #350
1 parent 95b3e2d commit ca39416

9 files changed

Lines changed: 1665 additions & 1669 deletions

File tree

src/AdoNet.Specification.Tests/AdoNet.Specification.Tests.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333
</PropertyGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="xunit" Version="2.7.0" />
37-
<PackageReference Include="xunit.extensibility.execution" Version="2.7.0" />
38-
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
36+
<PackageReference Include="xunit.v3.assert" Version="3.2.1" />
37+
<PackageReference Include="xunit.v3.extensibility.core" Version="3.2.1" />
3938
</ItemGroup>
4039

4140
<ItemGroup>

src/AdoNet.Specification.Tests/DbFactoryTestBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ protected DbFactoryTestBase(TFixture fixture)
1818
CanceledToken = m_cancellationTokenSource.Token;
1919
}
2020

21-
public async Task InitializeAsync()
21+
public async ValueTask InitializeAsync()
2222
{
2323
await OnInitializeAsync().ConfigureAwait(false);
2424
}
2525

26-
public async Task DisposeAsync()
26+
public async ValueTask DisposeAsync()
2727
{
2828
await OnDisposeAsync().ConfigureAwait(false);
2929
}

src/AdoNet.Specification.Tests/DbProviderFactoryTestBase.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Data;
3-
using System.Data.Common;
4-
using System.Security.Cryptography.X509Certificates;
5-
using System.Threading.Tasks;
61
using Xunit;
7-
using Xunit.Sdk;
82

93
namespace AdoNet.Specification.Tests;
104

@@ -44,11 +38,11 @@ protected DbProviderFactoryTestBase(TFixture fixture)
4438
public virtual void DbProviderFactory_CanCreateDataSourceEnumerator_is_accurate() => Assert.Equal(Fixture.Factory.CanCreateDataSourceEnumerator, Fixture.Factory.CreateDataSourceEnumerator() is object);
4539

4640
#if NETSTANDARD2_0
47-
[SkippableFact]
48-
public virtual void DbProviderFactory_CanCreateCommandBuilder_is_true() => throw new Xunit.SkipException("Not supported on this TargetFramework");
41+
[Fact]
42+
public virtual void DbProviderFactory_CanCreateCommandBuilder_is_true() => throw Xunit.Sdk.SkipException.ForSkip("Not supported on this TargetFramework");
4943

50-
[SkippableFact]
51-
public virtual void DbProviderFactory_CanCreateDataAdapter_is_true() => throw new Xunit.SkipException("Not supported on this TargetFramework");
44+
[Fact]
45+
public virtual void DbProviderFactory_CanCreateDataAdapter_is_true() => throw Xunit.Sdk.SkipException.ForSkip("Not supported on this TargetFramework");
5246
#else
5347
[Fact]
5448
public virtual void DbProviderFactory_CanCreateCommandBuilder_is_true() => Assert.True(Fixture.Factory.CanCreateCommandBuilder);

src/AdoNet.Specification.Tests/GetValueConversionTestBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ await DoTestAsync(dbType, kind, async reader =>
7272
protected virtual void DoTest(DbType dbType, ValueKind kind, Action<DbDataReader> action)
7373
{
7474
if (!Fixture.SupportedDbTypes.Contains(dbType))
75-
throw new Xunit.SkipException("Database doesn't support this data type");
75+
throw Xunit.Sdk.SkipException.ForSkip("Database doesn't support this data type");
7676

7777
using var connection = CreateOpenConnection();
7878
using var command = connection.CreateCommand();
@@ -85,7 +85,7 @@ protected virtual void DoTest(DbType dbType, ValueKind kind, Action<DbDataReader
8585
protected virtual async Task DoTestAsync(DbType dbType, ValueKind kind, Func<DbDataReader, Task> action)
8686
{
8787
if (!Fixture.SupportedDbTypes.Contains(dbType))
88-
throw new Xunit.SkipException("Database doesn't support this data type");
88+
throw Xunit.Sdk.SkipException.ForSkip("Database doesn't support this data type");
8989

9090
using var connection = CreateOpenConnection();
9191
using var command = connection.CreateCommand();

src/AdoNet.Specification.Tests/GetValueConversionTestBase.g.cs

Lines changed: 1649 additions & 1649 deletions
Large diffs are not rendered by default.

tests/Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<ItemGroup>
3-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
4-
<PackageReference Include="xunit" Version="2.7.0" />
5-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" />
3+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
4+
<PackageReference Include="xunit.v3" Version="3.2.1" />
5+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
66
</ItemGroup>
77
</Project>

tests/DotConnectMySql.Tests/DotConnectMySql.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net48</TargetFramework>
55
<LangVersion>10.0</LangVersion>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78

89
<ItemGroup>

tests/DotConnectPostgres.Tests/DotConnectPostgres.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net48</TargetFramework>
55
<LangVersion>10.0</LangVersion>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78

89
<ItemGroup>

tests/SqlClientBcl.Tests/SqlClientBcl.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net48</TargetFramework>
55
<LangVersion>10.0</LangVersion>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78

89
<ItemGroup>

0 commit comments

Comments
 (0)