Skip to content

Commit df8effb

Browse files
committed
upgrade TUnit
1 parent 88ab22e commit df8effb

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,11 @@ jobs:
2424
- name: Build
2525
run: dotnet build --no-restore
2626

27-
- name: Test
28-
run: dotnet test --no-build --verbosity normal
27+
- name: Test (VSTest)
28+
run: |
29+
dotnet test MSTest/MSTest.csproj --no-build --verbosity normal
30+
dotnet test NUnit/NUnitTests.csproj --no-build --verbosity normal
31+
dotnet test XUnitTests/XUnitTests.csproj --no-build --verbosity normal
32+
33+
- name: Test (TUnit)
34+
run: dotnet run --project TUnitTests/TUnitTests.csproj --no-build

TUnitTests/TUnitAssertions.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
using System.Collections;
22
using System.Data;
33
using System.Text.RegularExpressions;
4-
using TUnit.Assertions.AssertConditions;
5-
using TUnit.Assertions.AssertConditions.Throws;
6-
using TUnit.Assertions.Enums;
4+
using TUnit.Assertions.Extensions;
75

86
namespace TUnitTests;
97

@@ -14,7 +12,6 @@ public async Task Test1()
1412
{
1513
bool? actual = true;
1614
await Assert.That(actual).IsTrue();
17-
await Assert.That(actual).IsNotFalse();
1815
await Assert.That(actual).IsNotNull();
1916

2017
actual = null;
@@ -62,14 +59,14 @@ public async Task ExceptionsDerived()
6259

6360
Func<Task> asyncSut = () => throw new ArgumentException("cause");
6461
var ex2 = await Assert.ThrowsAsync<Exception>(asyncSut);
65-
await Assert.That(ex2.Message).IsEqualTo("cause");
62+
await Assert.That(ex2!.Message).IsEqualTo("cause");
6663
}
6764

6865
[Test]
6966
public async Task Types()
7067
{
7168
ICollection collection = new ArrayList();
72-
await Assert.That(collection).IsAssignableFrom(typeof(ArrayList));
69+
await Assert.That(collection).IsAssignableFrom<ArrayList>();
7370
await Assert.That(collection).IsTypeOf<ArrayList>();
7471
}
7572

@@ -81,8 +78,7 @@ public async Task Collections()
8178

8279
await Assert.That(actual).IsNotEmpty();
8380
await Assert.That(actual).IsEquivalentTo(new[] { 3, 2, 1 });
84-
await Assert.That(actual).IsNotEquivalentTo(expected);
85-
await Assert.That(actual).IsEquivalentTo(expected, CollectionOrdering.Any);
81+
await Assert.That(actual).IsEquivalentTo(expected); // ignores order by default
8682

8783
await Assert.That(actual).Contains(2);
8884
await Assert.That(actual).DoesNotContain(5);
@@ -104,7 +100,6 @@ public async Task Numbers()
104100
await Assert.That(actual).IsGreaterThan(0);
105101
await Assert.That(actual).IsLessThanOrEqualTo(100);
106102
await Assert.That(actual).IsPositive();
107-
await Assert.That(actual).IsNotNegative();
108103
await Assert.That(actual).IsNotZero();
109104
}
110105

TUnitTests/TUnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="TUnit" Version="0.18.9" />
11+
<PackageReference Include="TUnit" Version="1.19.57" />
1212
</ItemGroup>
1313

1414
</Project>

0 commit comments

Comments
 (0)