Skip to content

Commit 39f4900

Browse files
authored
Rename the misnamed NUnit VerifyBase.ThrowsValueTask<T> overload (#1886)
VerifyBase declared ThrowsValueTask<T>(Func<Task<T>>), which forwards to Verifier.ThrowsTask. The name was a copy paste error: the static API and MSTest's VerifyBase both call this ThrowsTask<T>. So NUnit's VerifyBase had no generic ThrowsTask at all, and ThrowsValueTask was overloaded across unrelated Task<T> and ValueTask<T> signatures. Code moved between the static and instance APIs, or from MSTest, did not compile against the name it expected. Renamed rather than kept alongside an obsolete forwarder, since a forwarder would preserve the overload confusion that is the actual problem here. Callers of the old name change to ThrowsTask, which is the method they were already reaching.
1 parent 5760ad9 commit 39f4900

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Verify.NUnit/VerifyBase_Throws.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public SettingsTask ThrowsTask(
2424
Verifier.ThrowsTask(target, settings ?? this.settings, sourceFile, lineNumber);
2525

2626
[Pure]
27-
public SettingsTask ThrowsValueTask<T>(
27+
public SettingsTask ThrowsTask<T>(
2828
Func<Task<T>> target,
2929
VerifySettings? settings = null,
3030
[CallerLineNumber] int lineNumber = 0) =>

0 commit comments

Comments
 (0)