Skip to content

Commit a460619

Browse files
committed
Update Xunit to 2.5.
Use 2.5.1-pre.4 to get the fix for xunit/xunit#2741.
1 parent 74c0eaa commit a460619

7 files changed

+14
-13
lines changed

NuGet.config

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
<configuration>
33
<packageSources>
44
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
<add key="myget.org" value="https://www.myget.org/F/xunit/api/v3/index.json" protocolVersion="3" />
56
</packageSources>
67
</configuration>

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
</PropertyGroup>
2929

3030
<ItemGroup>
31-
<PackageReference Include="xunit" Version="2.4.2" />
32-
<PackageReference Include="xunit.extensibility.execution" Version="2.4.2" />
31+
<PackageReference Include="xunit" Version="2.5.1-pre.4" />
32+
<PackageReference Include="xunit.extensibility.execution" Version="2.5.1-pre.4" />
3333
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
3434
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
3535
</ItemGroup>

src/AdoNet.Specification.Tests/CommandTestBase.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,9 @@ public virtual void Execute_throws_for_unknown_ParameterValue_type()
583583
catch (Exception ex) when (ex is NotSupportedException || ex is InvalidOperationException)
584584
{
585585
}
586-
catch (Exception ex) when (!(ex is UnexpectedValueException))
586+
catch (Exception ex) when (ex is not UnexpectedValueException)
587587
{
588-
throw new ThrowsException(typeof(NotSupportedException), ex);
588+
throw ThrowsException.ForIncorrectExceptionType(typeof(NotSupportedException), ex);
589589
}
590590
}
591591

src/AdoNet.Specification.Tests/DataReaderTestBase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ public virtual void GetColumnSchema_DataType()
10341034
case TypeCode.UInt64:
10351035
return;
10361036
}
1037-
Assert.True(false, "DataType isn't numeric");
1037+
Assert.Fail("DataType isn't numeric");
10381038
}
10391039

10401040
private void TestGetTextReader(ValueKind valueKind, string expected)

src/AdoNet.Specification.Tests/DbFactoryTestBase.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected static Exception AssertThrowsAny<TException1, TException2>(Action acti
7171
try
7272
{
7373
action();
74-
throw new ThrowsException(typeof(TException1));
74+
throw ThrowsException.ForNoException(typeof(TException1));
7575
}
7676
catch (TException1 ex)
7777
{
@@ -83,7 +83,7 @@ protected static Exception AssertThrowsAny<TException1, TException2>(Action acti
8383
}
8484
catch (Exception ex)
8585
{
86-
throw new ThrowsException(typeof(TException1), ex);
86+
throw ThrowsException.ForIncorrectExceptionType(typeof(TException1), ex);
8787
}
8888
}
8989

@@ -95,7 +95,7 @@ protected static Exception AssertThrowsAny<TException1, TException2, TException3
9595
try
9696
{
9797
action();
98-
throw new ThrowsException(typeof(TException1));
98+
throw ThrowsException.ForNoException(typeof(TException1));
9999
}
100100
catch (TException1 ex)
101101
{
@@ -111,7 +111,7 @@ protected static Exception AssertThrowsAny<TException1, TException2, TException3
111111
}
112112
catch (Exception ex)
113113
{
114-
throw new ThrowsException(typeof(TException1), ex);
114+
throw ThrowsException.ForIncorrectExceptionType(typeof(TException1), ex);
115115
}
116116
}
117117

src/AdoNet.Specification.Tests/GetValueConversionTestBase.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected virtual void TestException<T>(DbType dbType, ValueKind kind, Func<DbDa
4343
}
4444
catch (Exception ex)
4545
{
46-
throw new ThrowsException(exceptionType, ex);
46+
throw ThrowsException.ForIncorrectExceptionType(exceptionType, ex);
4747
}
4848
});
4949

@@ -65,7 +65,7 @@ await DoTestAsync(dbType, kind, async reader =>
6565
}
6666
catch (Exception ex)
6767
{
68-
throw new ThrowsException(exceptionType, ex);
68+
throw ThrowsException.ForIncorrectExceptionType(exceptionType, ex);
6969
}
7070
});
7171

tests/Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<ItemGroup>
33
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
4-
<PackageReference Include="xunit" Version="2.4.2" />
5-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
4+
<PackageReference Include="xunit" Version="2.5.1-pre.4" />
5+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" />
66
</ItemGroup>
77
</Project>

0 commit comments

Comments
 (0)