Skip to content

Commit 9209724

Browse files
authored
Upgrade xunit version to 2.9.0 (#57303)
* Upgrade Xunit version to 2.9.0 * React to removed/changed xunit exceptions * Fix ambiguous calls * Replace Assert.True(false, ...) with Assert.Fail * Await async methods and change async void -> async Task * Use Assert.Equal for string equality checks * Apply analyzer fixes: use Assert.Single and Assert.Empty * Apply analyzer fixes: null parameter in Theory data * Fix TheoryData generic mismatch * Test methods can't return value * Suppress Do not call ConfigureAwait(false) in test method * Suppress Do not use blocking task operations in test method * Suppress Fixture arguments to test classes must have fixture sources * Fix DllNotFoundException in HttpApi on non-Windows platforms * Disable tests that were unintentionally skipped before and fail now * Fix generated test code * Disable generated tests that were unintentionally skipped before and fail now * Add issue link to ResultsOfTTests.Generated.cs * Add issue link to UserManagerTest.cs * Disable xUnit1030 globally * Move check for HttpApi into test code * Revert changes to ResultsOfTTests, they were fixed
1 parent 30fb87c commit 9209724

File tree

270 files changed

+870
-836
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+870
-836
lines changed

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@
130130
<!-- xUnit1004 = warns about skipped tests. Make this a non-fatal build warning. -->
131131
<WarningsNotAsErrors>$(WarningsNotAsErrors);xUnit1004</WarningsNotAsErrors>
132132

133+
<!-- don't warn about calling ConfigureAwait in test methods. we already commonly get off the xunit threads because they cause issues. -->
134+
<NoWarn>$(NoWarn);xUnit1030</NoWarn>
135+
133136
<!-- don't warn about unnecessary trim warning suppressions. can be removed with preview 6. -->
134137
<NoWarn>$(NoWarn);IL2121</NoWarn>
135138

eng/Versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,12 @@
322322
<SwashbuckleAspNetCoreVersion>6.6.2</SwashbuckleAspNetCoreVersion>
323323
<VerifyXunitVersion>19.14.0</VerifyXunitVersion>
324324
<XunitAbstractionsVersion>2.0.3</XunitAbstractionsVersion>
325-
<XunitAnalyzersVersion>1.0.0</XunitAnalyzersVersion>
326-
<XunitVersion>2.4.2</XunitVersion>
325+
<XunitAnalyzersVersion>1.15.0</XunitAnalyzersVersion>
326+
<XunitVersion>2.9.0</XunitVersion>
327327
<XunitAssertVersion>$(XunitVersion)</XunitAssertVersion>
328328
<XunitExtensibilityCoreVersion>$(XunitVersion)</XunitExtensibilityCoreVersion>
329329
<XunitExtensibilityExecutionVersion>$(XunitVersion)</XunitExtensibilityExecutionVersion>
330-
<XUnitRunnerVisualStudioVersion>2.4.3</XUnitRunnerVisualStudioVersion>
330+
<XUnitRunnerVisualStudioVersion>2.8.2</XUnitRunnerVisualStudioVersion>
331331
<MicrosoftDataSqlClientVersion>4.0.5</MicrosoftDataSqlClientVersion>
332332
<MicrosoftOpenApiVersion>1.6.17</MicrosoftOpenApiVersion>
333333
<MicrosoftOpenApiReadersVersion>1.6.17</MicrosoftOpenApiReadersVersion>

src/Analyzers/Microsoft.AspNetCore.Analyzer.Testing/src/Assert.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static void DiagnosticLocation(DiagnosticLocation expected, Location actu
1818
{
1919
if (actualLinePosition.Line + 1 != expected.Line)
2020
{
21-
throw new DiagnosticLocationAssertException(
21+
throw EqualException.ForMismatchedValues(
2222
expected,
2323
actual,
2424
$"Expected diagnostic to be on line \"{expected.Line}\" was actually on line \"{actualLinePosition.Line + 1}\"");
@@ -30,25 +30,11 @@ public static void DiagnosticLocation(DiagnosticLocation expected, Location actu
3030
{
3131
if (actualLinePosition.Character + 1 != expected.Column)
3232
{
33-
throw new DiagnosticLocationAssertException(
33+
throw EqualException.ForMismatchedValues(
3434
expected,
3535
actual,
3636
$"Expected diagnostic to start at column \"{expected.Column}\" was actually on column \"{actualLinePosition.Character + 1}\"");
3737
}
3838
}
3939
}
40-
41-
private sealed class DiagnosticLocationAssertException : EqualException
42-
{
43-
public DiagnosticLocationAssertException(
44-
DiagnosticLocation expected,
45-
Location actual,
46-
string message)
47-
: base(expected, actual)
48-
{
49-
Message = message;
50-
}
51-
52-
public override string Message { get; }
53-
}
5440
}

src/Antiforgery/test/BinaryBlobTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ public void Ctor_Data()
5656
[Theory]
5757
[InlineData((object[]?)null)]
5858
[InlineData(new byte[] { 0x01, 0x02, 0x03 })]
59-
public void Ctor_Data_Bad(byte[] data)
59+
public void Ctor_Data_Bad(byte[]? data)
6060
{
6161
// Act & assert
62-
var ex = Assert.Throws<ArgumentOutOfRangeException>(() => new BinaryBlob(32, data));
62+
var ex = Assert.Throws<ArgumentOutOfRangeException>(() => new BinaryBlob(32, data!));
6363
Assert.Equal("data", ex.ParamName);
6464
}
6565

src/Antiforgery/test/DefaultAntiforgeryTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ public void SetCookieTokenAndHeader_OverridesExistingCachingHeaders()
10791079
[InlineData(true, null)]
10801080
public void SetCookieTokenAndHeader_AddsXFrameOptionsHeader(
10811081
bool suppressXFrameOptions,
1082-
string expectedHeaderValue)
1082+
string? expectedHeaderValue)
10831083
{
10841084
// Arrange
10851085
var options = new AntiforgeryOptions()

src/Antiforgery/test/DefaultAntiforgeryTokenStoreTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public void SaveCookieToken_HonorsCookieSecurePolicy_OnOptions(
396396
[InlineData("/", "/")]
397397
[InlineData("/vdir1", "/vdir1")]
398398
[InlineData("/vdir1/vdir2", "/vdir1/vdir2")]
399-
public void SaveCookieToken_SetsCookieWithApproriatePathBase(string requestPathBase, string expectedCookiePath)
399+
public void SaveCookieToken_SetsCookieWithApproriatePathBase(string? requestPathBase, string expectedCookiePath)
400400
{
401401
// Arrange
402402
var token = "serialized-value";

src/Components/Analyzers/test/Verifiers/CodeFixVerifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private void VerifyFix(string language, DiagnosticAnalyzer analyzer, CodeFixProv
109109
document = document.WithSyntaxRoot(Formatter.Format(document.GetSyntaxRootAsync().Result, Formatter.Annotation, document.Project.Solution.Workspace));
110110
newCompilerDiagnostics = GetNewDiagnostics(compilerDiagnostics, GetCompilerDiagnostics(document));
111111

112-
Assert.True(false,
112+
Assert.Fail(
113113
string.Format(
114114
CultureInfo.InvariantCulture,
115115
"Fix introduced new compiler diagnostics:\r\n{0}\r\n\r\nNew document:\r\n{1}\r\n",

src/Components/Analyzers/test/Verifiers/DiagnosticVerifier.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResult
112112
{
113113
string diagnosticsOutput = actualResults.Any() ? FormatDiagnostics(analyzer, actualResults.ToArray()) : " NONE.";
114114

115-
Assert.True(false,
115+
Assert.Fail(
116116
string.Format(CultureInfo.InvariantCulture, "Mismatch between number of diagnostics returned, expected \"{0}\" actual \"{1}\"\r\n\r\nDiagnostics:\r\n{2}\r\n", expectedCount, actualCount, diagnosticsOutput));
117117
}
118118

@@ -125,7 +125,7 @@ private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResult
125125
{
126126
if (actual.Location != Location.None)
127127
{
128-
Assert.True(false,
128+
Assert.Fail(
129129
string.Format(CultureInfo.InvariantCulture, "Expected:\nA project diagnostic with No location\nActual:\n{0}",
130130
FormatDiagnostics(analyzer, actual)));
131131
}
@@ -137,7 +137,7 @@ private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResult
137137

138138
if (additionalLocations.Length != expected.Locations.Length - 1)
139139
{
140-
Assert.True(false,
140+
Assert.Fail(
141141
string.Format(
142142
CultureInfo.InvariantCulture,
143143
"Expected {0} additional locations but got {1} for Diagnostic:\r\n {2}\r\n",
@@ -153,7 +153,7 @@ private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResult
153153

154154
if (actual.Id != expected.Id)
155155
{
156-
Assert.True(false,
156+
Assert.Fail(
157157
string.Format(
158158
CultureInfo.InvariantCulture,
159159
"Expected diagnostic id to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
@@ -162,7 +162,7 @@ private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResult
162162

163163
if (actual.Severity != expected.Severity)
164164
{
165-
Assert.True(false,
165+
Assert.Fail(
166166
string.Format(
167167
CultureInfo.InvariantCulture,
168168
"Expected diagnostic severity to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
@@ -171,7 +171,7 @@ private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResult
171171

172172
if (actual.GetMessage(CultureInfo.InvariantCulture) != expected.Message)
173173
{
174-
Assert.True(false,
174+
Assert.Fail(
175175
string.Format(
176176
CultureInfo.InvariantCulture,
177177
"Expected diagnostic message to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
@@ -204,7 +204,7 @@ private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagno
204204
{
205205
if (actualLinePosition.Line + 1 != expected.Line)
206206
{
207-
Assert.True(false,
207+
Assert.Fail(
208208
string.Format(
209209
CultureInfo.InvariantCulture,
210210
"Expected diagnostic to be on line \"{0}\" was actually on line \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
@@ -217,7 +217,7 @@ private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagno
217217
{
218218
if (actualLinePosition.Character + 1 != expected.Column)
219219
{
220-
Assert.True(false,
220+
Assert.Fail(
221221
string.Format(
222222
CultureInfo.InvariantCulture,
223223
"Expected diagnostic to start at column \"{0}\" was actually at column \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",

src/Components/Authorization/test/AuthorizeViewTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public async Task RendersAuthorizingUntilAuthorizationCompletedAsync()
321321
// (This wouldn't happen under the sync context or in wasm)
322322
var renderTcs = new TaskCompletionSource();
323323
renderer.OnUpdateDisplayComplete = () => renderTcs.SetResult();
324-
authTcs.SetResult(CreateAuthenticationState("Monsieur").Result);
324+
authTcs.SetResult(await CreateAuthenticationState("Monsieur"));
325325

326326
await renderTcs.Task;
327327
Assert.Equal(2, renderer.Batches.Count);
@@ -347,7 +347,7 @@ public async Task RendersAuthorizingUntilAuthorizationCompletedAsync()
347347
}
348348

349349
[Fact]
350-
public void RendersAuthorizingUntilAuthorizationCompleted()
350+
public async Task RendersAuthorizingUntilAuthorizationCompleted()
351351
{
352352
// Arrange
353353
var @event = new ManualResetEventSlim();
@@ -377,7 +377,7 @@ public void RendersAuthorizingUntilAuthorizationCompleted()
377377

378378
// Act/Assert 2: Auth process completes asynchronously
379379
@event.Reset();
380-
authTcs.SetResult(CreateAuthenticationState("Monsieur").Result);
380+
authTcs.SetResult(await CreateAuthenticationState("Monsieur"));
381381

382382
// We need to wait here because the continuations of SetResult will be scheduled to run asynchronously.
383383
@event.Wait(Timeout);

src/Components/Components/test/LayoutViewTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public void CanChangeContentWithSameLayout()
178178
// Assert
179179
Assert.Equal(2, _renderer.Batches.Count);
180180
var batch = _renderer.Batches[1];
181-
Assert.Equal(0, batch.DisposedComponentIDs.Count);
181+
Assert.Empty(batch.DisposedComponentIDs);
182182
Assert.Collection(batch.DiffsInOrder,
183183
diff => Assert.Empty(diff.Edits), // LayoutView rerendered, but with no changes
184184
diff => Assert.Empty(diff.Edits), // RootLayout rerendered, but with no changes
@@ -220,7 +220,7 @@ public void CanChangeLayout()
220220
Assert.True(setParametersTask2.IsCompletedSuccessfully);
221221
Assert.Equal(2, _renderer.Batches.Count);
222222
var batch = _renderer.Batches[1];
223-
Assert.Equal(1, batch.DisposedComponentIDs.Count); // Disposes NestedLayout
223+
Assert.Single(batch.DisposedComponentIDs); // Disposes NestedLayout
224224
Assert.Collection(batch.DiffsInOrder,
225225
diff => Assert.Empty(diff.Edits), // LayoutView rerendered, but with no changes
226226
diff =>

src/Components/Components/test/NavigationManagerTest.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ public void LocationChangingHandlers_CanContinueTheNavigationSynchronously_WhenO
223223

224224
// Assert
225225
Assert.True(navigation1.IsCompletedSuccessfully);
226+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
226227
Assert.True(navigation1.Result);
228+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
227229

228230
static ValueTask HandleLocationChanging(LocationChangingContext context)
229231
{
@@ -250,7 +252,9 @@ public void LocationChangingHandlers_CanContinueTheNavigationSynchronously_WhenM
250252

251253
// Assert
252254
Assert.True(navigation1.IsCompletedSuccessfully);
255+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
253256
Assert.True(navigation1.Result);
257+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
254258
Assert.Equal(initialHandlerCount, completedHandlerCount);
255259

256260
ValueTask HandleLocationChanging(LocationChangingContext context)
@@ -276,7 +280,9 @@ public void LocationChangingHandlers_CanContinueTheNavigationAsynchronously_When
276280
Assert.False(navigation1.IsCompleted);
277281
tcs.SetResult();
278282
Assert.True(navigation1.IsCompletedSuccessfully);
283+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
279284
Assert.True(navigation1.Result);
285+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
280286

281287
async ValueTask HandleLocationChanging(LocationChangingContext context)
282288
{
@@ -328,7 +334,9 @@ public void LocationChangingHandlers_CanCancelTheNavigationSynchronously_WhenOne
328334

329335
// Assert
330336
Assert.True(navigation1.IsCompletedSuccessfully);
337+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
331338
Assert.False(navigation1.Result);
339+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
332340

333341
static ValueTask HandleLocationChanging(LocationChangingContext context)
334342
{
@@ -357,7 +365,9 @@ public void LocationChangingHandlers_CanCancelTheNavigationSynchronously_WhenMul
357365

358366
// Assert
359367
Assert.True(navigation1.IsCompletedSuccessfully);
368+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
360369
Assert.False(navigation1.Result);
370+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
361371
Assert.Equal(expectedInvokedHandlerCount, invokedHandlerCount);
362372

363373
ValueTask HandleLocationChanging_AllowNavigation(LocationChangingContext context)
@@ -391,7 +401,9 @@ public void LocationChangingHandlers_CanCancelTheNavigationSynchronously_BeforeR
391401

392402
// Assert
393403
Assert.True(navigation1.IsCompletedSuccessfully);
404+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
394405
Assert.False(navigation1.Result);
406+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
395407
Assert.True(currentContext.DidPreventNavigation);
396408
Assert.True(currentContext.CancellationToken.IsCancellationRequested);
397409
Assert.False(isHandlerCompleted);
@@ -428,7 +440,9 @@ public void LocationChangingHandlers_CanCancelTheNavigationSynchronously_BeforeR
428440

429441
// Assert
430442
Assert.True(navigation1.IsCompletedSuccessfully);
443+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
431444
Assert.False(navigation1.Result);
445+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
432446
Assert.True(currentContext.DidPreventNavigation);
433447
Assert.True(currentContext.CancellationToken.IsCancellationRequested);
434448
Assert.False(isFirstHandlerCompleted);
@@ -455,7 +469,7 @@ ValueTask HandleLocationChanging_AllowNavigation(LocationChangingContext context
455469
}
456470

457471
[Fact]
458-
public async void LocationChangingHandlers_CanCancelTheNavigationAsynchronously_WhenOneHandlerIsRegistered()
472+
public async Task LocationChangingHandlers_CanCancelTheNavigationAsynchronously_WhenOneHandlerIsRegistered()
459473
{
460474
// Arrange
461475
var baseUri = "scheme://host/";
@@ -479,7 +493,7 @@ static async ValueTask HandleLocationChanging(LocationChangingContext context)
479493
}
480494

481495
[Fact]
482-
public async void LocationChangingHandlers_CanCancelTheNavigationAsynchronously_WhenMultipleHandlersAreRegistered()
496+
public async Task LocationChangingHandlers_CanCancelTheNavigationAsynchronously_WhenMultipleHandlersAreRegistered()
483497
{
484498
// Arrange
485499
var baseUri = "scheme://host/";
@@ -503,7 +517,9 @@ public async void LocationChangingHandlers_CanCancelTheNavigationAsynchronously_
503517

504518
// Assert
505519
Assert.True(navigation1.IsCompletedSuccessfully);
520+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
506521
Assert.False(navigation1.Result);
522+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
507523
Assert.Equal(blockNavigationHandlerCount, canceledBlockNavigationHandlerCount);
508524

509525
async ValueTask HandleLocationChanging_BlockNavigation(LocationChangingContext context)
@@ -556,11 +572,13 @@ public async Task LocationChangingHandlers_AreCanceledBySuccessiveNavigations_Wh
556572
await tcs.Task.WaitAsync(Timeout);
557573

558574
// Assert
575+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
559576
Assert.True(navigation1.IsCompletedSuccessfully);
560577
Assert.False(navigation1.Result);
561578

562579
Assert.True(navigation2.IsCompletedSuccessfully);
563580
Assert.True(navigation2.Result);
581+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
564582

565583
async ValueTask HandleLocationChanging(LocationChangingContext context)
566584
{
@@ -615,6 +633,7 @@ public async Task LocationChangingHandlers_AreCanceledBySuccessiveNavigations_Wh
615633
await tcs.Task.WaitAsync(Timeout);
616634

617635
// Assert
636+
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
618637
Assert.True(navigation1.IsCompletedSuccessfully);
619638
Assert.False(navigation1.Result);
620639

@@ -623,6 +642,7 @@ public async Task LocationChangingHandlers_AreCanceledBySuccessiveNavigations_Wh
623642

624643
Assert.True(navigation3.IsCompletedSuccessfully);
625644
Assert.True(navigation3.Result);
645+
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
626646

627647
Assert.Equal(expectedCanceledHandlerCount, canceledHandlerCount);
628648
Assert.Equal(0, completedHandlerCount);

src/Components/Components/test/RendererTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,8 +3065,8 @@ public void QueuedRenderIsSkippedIfComponentWasAlreadyDisposedInSameBatch()
30653065
// Assert: correct render result
30663066
Assert.True(renderTask.IsCompletedSuccessfully);
30673067
var newBatch = renderer.Batches.Skip(1).Single();
3068-
Assert.Equal(1, newBatch.DisposedComponentIDs.Count);
3069-
Assert.Equal(1, newBatch.DiffsByComponentId.Count);
3068+
Assert.Single(newBatch.DisposedComponentIDs);
3069+
Assert.Single(newBatch.DiffsByComponentId);
30703070
Assert.Collection(newBatch.DiffsByComponentId[componentId].Single().Edits,
30713071
edit =>
30723072
{
@@ -3433,7 +3433,7 @@ public void DoesNotCallOnAfterRenderForComponentsNotRendered()
34333433
// Assert: Only the re-rendered component was notified of "after render"
34343434
var batch2 = renderer.Batches.Skip(1).Single();
34353435
Assert.Equal(2, batch2.DiffsInOrder.Count); // Parent and first child
3436-
Assert.Equal(1, batch2.DisposedComponentIDs.Count); // Third child
3436+
Assert.Single(batch2.DisposedComponentIDs); // Third child
34373437
Assert.Equal(2, childComponents[0].OnAfterRenderCallCount); // Retained and re-rendered
34383438
Assert.Equal(1, childComponents[1].OnAfterRenderCallCount); // Retained and not re-rendered
34393439
Assert.Equal(1, childComponents[2].OnAfterRenderCallCount); // Disposed

src/Components/Components/test/ResourceAssetCollectionTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public void CanCreateResourceCollection()
1717
var collectionAsReadOnlyList = resourceAssetCollection as IReadOnlyList<ResourceAsset>;
1818

1919
// Assert
20-
Assert.Equal(1, collectionAsReadOnlyList.Count);
20+
Assert.Single(collectionAsReadOnlyList);
2121
Assert.Equal("image1.jpg", collectionAsReadOnlyList[0].Url);
2222
}
2323

src/Components/Components/test/Routing/RouterTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public async Task AlreadyCanceledOnNavigateAsyncDoesNothing()
111111
Assert.True(true);
112112
return;
113113
}
114-
Assert.True(false, "OnUpdateDisplay called more than once.");
114+
Assert.Fail("OnUpdateDisplay called more than once.");
115115
};
116116
_router.OnNavigateAsync = new EventCallback<NavigationContext>(null, OnNavigateAsync);
117117

@@ -164,7 +164,7 @@ public async Task RefreshesOnceOnCancelledOnNavigateAsync()
164164
Assert.True(true);
165165
return;
166166
}
167-
Assert.True(false, "OnUpdateDisplay called more than once.");
167+
Assert.Fail("OnUpdateDisplay called more than once.");
168168
};
169169
_router.OnNavigateAsync = new EventCallback<NavigationContext>(null, OnNavigateAsync);
170170

0 commit comments

Comments
 (0)