Skip to content

Commit 3908847

Browse files
Copilotascott18
andcommitted
fix: use Because() for custom TUnit messages and add global.json for dotnet test support
Co-authored-by: ascott18 <5017521+ascott18@users.noreply.github.com>
1 parent 851bd00 commit 3908847

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# 6.2.1
22

3+
## Template Changes
4+
- Template test projects now use TUnit instead of xUnit.
5+
36
# 6.2.0
47
- Add COA0014 analyzer to avoid incorrect usage of `NoAutoInclude`.
58
- Added `DefaultOrderByAttribute.Suppress` property to prevent properties from being used as fallback ordering.

templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data.Test/Utilities/AssertionExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static async Task AssertSuccess(this ApiResult result, string? message =
2929
{
3030
await Assert.That(result.WasSuccessful)
3131
.IsTrue()
32-
.WithMessage(() => result.Message ?? "");
32+
.Because(result.Message ?? "");
3333
await Assert.That(result.Message).IsEqualTo(message);
3434
}
3535

@@ -40,7 +40,7 @@ public static async Task<T> AssertSuccess<T>(this ItemResult<T> result)
4040
{
4141
await Assert.That(result.WasSuccessful)
4242
.IsTrue()
43-
.WithMessage(() => result.Message ?? "");
43+
.Because(result.Message ?? "");
4444
await Assert.That(result.Message).IsNull();
4545
return result.Object ?? throw new ArgumentException("Successful result unexpectedly returned null object");
4646
}
@@ -62,7 +62,7 @@ public static async Task AssertSuccess(this Task<ItemResult> resultTask)
6262
var result = await resultTask;
6363
await Assert.That(result.WasSuccessful)
6464
.IsTrue()
65-
.WithMessage(() => result.Message ?? "");
65+
.Because(result.Message ?? "");
6666
}
6767

6868
/// <summary>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test": {
3+
"runner": "Microsoft.Testing.Platform"
4+
}
5+
}

0 commit comments

Comments
 (0)