Skip to content

Commit fcfe71f

Browse files
authored
Merge pull request #1220 from AArnott/libtemplateUpdate
Merge latest Library.Template
2 parents 2af527b + 1ee6a1b commit fcfe71f

13 files changed

+50
-50
lines changed

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
55
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
6-
<MicroBuildVersion>2.0.130</MicroBuildVersion>
6+
<MicroBuildVersion>2.0.131</MicroBuildVersion>
77
<CodeAnalysisVersion>3.11.0</CodeAnalysisVersion>
88
<CodeAnalysisVersion Condition="'$(IsTestProject)'=='true'">4.4.0</CodeAnalysisVersion>
99
<CodefixTestingVersion>1.1.1</CodefixTestingVersion>
@@ -36,10 +36,10 @@
3636
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
3737
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
3838
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
39-
<PackageVersion Include="xunit" Version="2.4.2" />
39+
<PackageVersion Include="xunit" Version="2.5.0" />
4040
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
4141
<PackageVersion Include="Xunit.Combinatorial" Version="1.5.25" />
42-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
42+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.0" />
4343
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
4444
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
4545
</ItemGroup>

azure-pipelines/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- template: install-dependencies.yml
3535

36-
- script: dotnet tool run nbgv cloud -ca
36+
- script: dotnet nbgv cloud -ca
3737
displayName: ⚙ Set build number
3838

3939
- ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:

test/IsolatedTestHost/App.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
1111
<dependentAssembly>
1212
<assemblyIdentity name="xunit.core" publicKeyToken="8d05b1bb7a6fdb6c" culture="neutral" />
13-
<bindingRedirect oldVersion="0.0.0.0-2.4.2.0" newVersion="2.4.2.0" />
13+
<bindingRedirect oldVersion="0.0.0.0-2.5.0.0" newVersion="2.5.0.0" />
1414
</dependentAssembly>
1515
</assemblyBinding>
1616
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
1717
<dependentAssembly>
1818
<assemblyIdentity name="xunit.execution.desktop" publicKeyToken="8d05b1bb7a6fdb6c" culture="neutral" />
19-
<bindingRedirect oldVersion="0.0.0.0-2.4.2.0" newVersion="2.4.2.0" />
19+
<bindingRedirect oldVersion="0.0.0.0-2.5.0.0" newVersion="2.5.0.0" />
2020
</dependentAssembly>
2121
</assemblyBinding>
2222
</runtime>

test/Microsoft.VisualStudio.Threading.Tests/AssertEx.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ public static void Equal<T>(T expected, T actual, string message)
1010
{
1111
if (!EqualityComparer<T>.Default.Equals(expected, actual))
1212
{
13-
throw new Xunit.Sdk.AssertActualExpectedException(expected, actual, message);
13+
throw Xunit.Sdk.EqualException.ForMismatchedValues(expected, actual, message);
1414
}
1515
}
1616

1717
public static void Equal<T>(T expected, T actual, string formattingMessage, params object[] formattingArgs)
1818
{
1919
if (!EqualityComparer<T>.Default.Equals(expected, actual))
2020
{
21-
throw new Xunit.Sdk.AssertActualExpectedException(expected, actual, string.Format(CultureInfo.CurrentCulture, formattingMessage, formattingArgs));
21+
throw Xunit.Sdk.EqualException.ForMismatchedValues(expected, actual, string.Format(CultureInfo.CurrentCulture, formattingMessage, formattingArgs));
2222
}
2323
}
2424

2525
public static void NotEqual<T>(T expected, T actual, string message)
2626
{
2727
if (EqualityComparer<T>.Default.Equals(expected, actual))
2828
{
29-
throw new Xunit.Sdk.AssertActualExpectedException(expected, actual, message);
29+
throw Xunit.Sdk.NotEqualException.ForEqualValues(expected?.ToString() ?? "<null>", actual?.ToString() ?? "<null>", message);
3030
}
3131
}
3232

3333
public static void NotEqual<T>(T expected, T actual, string formattingMessage, params object[] formattingArgs)
3434
{
3535
if (EqualityComparer<T>.Default.Equals(expected, actual))
3636
{
37-
throw new Xunit.Sdk.AssertActualExpectedException(expected, actual, string.Format(CultureInfo.CurrentCulture, formattingMessage, formattingArgs));
37+
throw Xunit.Sdk.NotEqualException.ForEqualValues(expected?.ToString() ?? "<null>", actual?.ToString() ?? "<null>", string.Format(CultureInfo.CurrentCulture, formattingMessage, formattingArgs));
3838
}
3939
}
4040
}

test/Microsoft.VisualStudio.Threading.Tests/AsyncAutoResetEventTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void WaitAsync_WithCancellationToken_DoesNotClaimSignal()
121121
try
122122
{
123123
waitTask.GetAwaiter().GetResult();
124-
Assert.True(false, "Task was expected to transition to a canceled state.");
124+
Assert.Fail("Task was expected to transition to a canceled state.");
125125
}
126126
catch (OperationCanceledException ex)
127127
{
@@ -148,7 +148,7 @@ public void WaitAsync_WithCancellationToken_PrecanceledDoesNotClaimExistingSigna
148148
try
149149
{
150150
this.evt.WaitAsync(token).GetAwaiter().GetResult();
151-
Assert.True(false, "Task was expected to transition to a canceled state.");
151+
Assert.Fail("Task was expected to transition to a canceled state.");
152152
}
153153
catch (OperationCanceledException ex)
154154
{

test/Microsoft.VisualStudio.Threading.Tests/AsyncReaderWriterLockTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2652,7 +2652,7 @@ await Task.Run(delegate
26522652
try
26532653
{
26542654
awaiter.GetResult();
2655-
Assert.True(false, "Expected OperationCanceledException not thrown.");
2655+
Assert.Fail("Expected OperationCanceledException not thrown.");
26562656
}
26572657
catch (OperationCanceledException)
26582658
{
@@ -2670,7 +2670,7 @@ public void PrecancelledWriteLockAsyncRequestOnSTA()
26702670
try
26712671
{
26722672
awaiter.GetResult();
2673-
Assert.True(false, "Expected OperationCanceledException not thrown.");
2673+
Assert.Fail("Expected OperationCanceledException not thrown.");
26742674
}
26752675
catch (OperationCanceledException)
26762676
{
@@ -2702,7 +2702,7 @@ await Task.WhenAll(
27022702
try
27032703
{
27042704
awaiter.GetResult();
2705-
cancellationTestConcluded.SetException(new ThrowsException(typeof(OperationCanceledException)));
2705+
cancellationTestConcluded.SetException(ThrowsException.ForNoException(typeof(OperationCanceledException)));
27062706
}
27072707
catch (OperationCanceledException)
27082708
{
@@ -2740,7 +2740,7 @@ await Task.WhenAll(
27402740
try
27412741
{
27422742
awaiter.GetResult();
2743-
cancellationTestConcluded.SetException(new ThrowsException(typeof(OperationCanceledException)));
2743+
cancellationTestConcluded.SetException(ThrowsException.ForNoException(typeof(OperationCanceledException)));
27442744
}
27452745
catch (OperationCanceledException)
27462746
{
@@ -3026,7 +3026,7 @@ public void CompleteBlocksNewTopLevelLocksSTA()
30263026
try
30273027
{
30283028
awaiter.GetResult();
3029-
Assert.True(false, "Expected exception not thrown.");
3029+
Assert.Fail("Expected exception not thrown.");
30303030
}
30313031
catch (InvalidOperationException)
30323032
{
@@ -3047,7 +3047,7 @@ await Task.Run(delegate
30473047
try
30483048
{
30493049
awaiter.GetResult();
3050-
Assert.True(false, "Expected exception not thrown.");
3050+
Assert.Fail("Expected exception not thrown.");
30513051
}
30523052
catch (InvalidOperationException)
30533053
{
@@ -3448,7 +3448,7 @@ public async Task OnBeforeWriteLockReleasedDelegateThrows()
34483448
this.asyncLock.Complete();
34493449
}
34503450

3451-
Assert.True(false, "Expected exception not thrown.");
3451+
Assert.Fail("Expected exception not thrown.");
34523452
}
34533453
catch (AggregateException ex)
34543454
{
@@ -4184,7 +4184,7 @@ public async Task WriteNestsReadWithWriteReleasedFirstWithoutTaskRun()
41844184
try
41854185
{
41864186
await completingTask; // observe any exception.
4187-
Assert.True(false, "Expected exception not thrown.");
4187+
Assert.Fail("Expected exception not thrown.");
41884188
}
41894189
catch (CriticalErrorException ex)
41904190
{
@@ -4993,7 +4993,7 @@ private async Task MitigationAgainstAccidentalLockForkingHelper(Func<AsyncReader
49934993
bool dummy = this.asyncLock.IsReadLockHeld;
49944994
if (!successExpected)
49954995
{
4996-
Assert.True(false, "Expected exception not thrown.");
4996+
Assert.Fail("Expected exception not thrown.");
49974997
}
49984998
}
49994999
catch (Exception ex)
@@ -5009,7 +5009,7 @@ private async Task MitigationAgainstAccidentalLockForkingHelper(Func<AsyncReader
50095009
bool dummy = this.asyncLock.IsUpgradeableReadLockHeld;
50105010
if (!successExpected)
50115011
{
5012-
Assert.True(false, "Expected exception not thrown.");
5012+
Assert.Fail("Expected exception not thrown.");
50135013
}
50145014
}
50155015
catch (Exception ex)
@@ -5025,7 +5025,7 @@ private async Task MitigationAgainstAccidentalLockForkingHelper(Func<AsyncReader
50255025
bool dummy = this.asyncLock.IsWriteLockHeld;
50265026
if (!successExpected)
50275027
{
5028-
Assert.True(false, "Expected exception not thrown.");
5028+
Assert.Fail("Expected exception not thrown.");
50295029
}
50305030
}
50315031
catch (Exception ex)
@@ -5045,7 +5045,7 @@ private async Task MitigationAgainstAccidentalLockForkingHelper(Func<AsyncReader
50455045
try
50465046
{
50475047
releaser = await locker();
5048-
Assert.True(false, "Expected exception not thrown.");
5048+
Assert.Fail("Expected exception not thrown.");
50495049
}
50505050
catch (Exception ex)
50515051
{

test/Microsoft.VisualStudio.Threading.Tests/AsyncReaderWriterResourceLockTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public async Task PreparationSucceedsForConcurrentReadersWhenOneCancels()
310310
try
311311
{
312312
await resourceTask;
313-
Assert.True(false, "Expected OperationCanceledException not thrown.");
313+
Assert.Fail("Expected OperationCanceledException not thrown.");
314314
}
315315
catch (OperationCanceledException)
316316
{
@@ -461,7 +461,7 @@ public async Task PreparationIsAppliedToResourceImpactedByOutsideChangePredicate
461461
(resource, s) =>
462462
{
463463
Assert.Same(state, s);
464-
Assert.True(false, "Read locks should not invoke this.");
464+
Assert.Fail("Read locks should not invoke this.");
465465
return false;
466466
},
467467
state);
@@ -1216,7 +1216,7 @@ public async Task GetResourceAsyncRetriesFaultedPreparation()
12161216
try
12171217
{
12181218
await access.GetResourceAsync(1);
1219-
Assert.True(false, "Expected exception not thrown.");
1219+
Assert.Fail("Expected exception not thrown.");
12201220
}
12211221
catch (ApplicationException)
12221222
{
@@ -1242,7 +1242,7 @@ public async Task PrepareResourceForConcurrentAccessAsync_ThrowsDuringReadShould
12421242
try
12431243
{
12441244
Resource? resource = await access.GetResourceAsync(1);
1245-
Assert.True(false, "Expected exception not thrown.");
1245+
Assert.Fail("Expected exception not thrown.");
12461246
}
12471247
catch (ApplicationException)
12481248
{
@@ -1275,7 +1275,7 @@ public async Task PrepareResourceForConcurrentAccessAsync_ThrowsReleasingWriteSh
12751275
try
12761276
{
12771277
await writeAccess.ReleaseAsync();
1278-
Assert.True(false, "Expected exception not thrown.");
1278+
Assert.Fail("Expected exception not thrown.");
12791279
}
12801280
catch (ApplicationException)
12811281
{
@@ -1285,7 +1285,7 @@ public async Task PrepareResourceForConcurrentAccessAsync_ThrowsReleasingWriteSh
12851285
}
12861286

12871287
// Exiting the using block should also throw.
1288-
Assert.True(false, "Expected exception not thrown.");
1288+
Assert.Fail("Expected exception not thrown.");
12891289
}
12901290
catch (ApplicationException)
12911291
{
@@ -1308,7 +1308,7 @@ public async Task PrepareResourceForConcurrentAccessAsync_ThrowsReleasingWriteSh
13081308
try
13091309
{
13101310
await readAccess.GetResourceAsync(1);
1311-
Assert.True(false, "Expected exception not thrown.");
1311+
Assert.Fail("Expected exception not thrown.");
13121312
}
13131313
catch (ApplicationException)
13141314
{

test/Microsoft.VisualStudio.Threading.Tests/AsyncSemaphoreTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public async Task ContestedAndCancelledWithTimeoutSpecified()
158158
try
159159
{
160160
await second;
161-
Assert.True(false, "Expected OperationCanceledException not thrown.");
161+
Assert.Fail("Expected OperationCanceledException not thrown.");
162162
}
163163
catch (OperationCanceledException ex)
164164
{
@@ -176,7 +176,7 @@ public void PreCancelled()
176176
try
177177
{
178178
enterAsyncTask.GetAwaiter().GetResult();
179-
Assert.True(false, "Expected exception not thrown.");
179+
Assert.Fail("Expected exception not thrown.");
180180
}
181181
catch (OperationCanceledException ex)
182182
{

test/Microsoft.VisualStudio.Threading.Tests/AwaitExtensionsTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public async Task ConfigureAwaitForAggregateException_ThrowsAggregateException()
507507
try
508508
{
509509
await joint.ConfigureAwaitForAggregateException();
510-
Assert.False(true, "Exception was not thrown.");
510+
Assert.Fail("Exception was not thrown.");
511511
}
512512
catch (AggregateException ex)
513513
{
@@ -523,7 +523,7 @@ public async Task ConfigureAwaitForAggregateException_Canceled()
523523
try
524524
{
525525
await canceled.ConfigureAwaitForAggregateException();
526-
Assert.False(true, "Exception was not thrown.");
526+
Assert.Fail("Exception was not thrown.");
527527
}
528528
catch (OperationCanceledException)
529529
{
@@ -540,7 +540,7 @@ public async Task ConfigureAwaitForAggregateException_InnerCanceled()
540540
try
541541
{
542542
await joint.ConfigureAwaitForAggregateException();
543-
Assert.False(true, "Exception was not thrown.");
543+
Assert.Fail("Exception was not thrown.");
544544
}
545545
catch (OperationCanceledException)
546546
{
@@ -557,7 +557,7 @@ public async Task ConfigureAwaitForAggregateException_InnerCanceledAndFaulted()
557557
try
558558
{
559559
await joint.ConfigureAwaitForAggregateException();
560-
Assert.False(true, "Exception was not thrown.");
560+
Assert.Fail("Exception was not thrown.");
561561
}
562562
catch (AggregateException ex)
563563
{
@@ -718,7 +718,7 @@ public async Task AwaitRegKeyChange_Canceled()
718718
try
719719
{
720720
await changeWatcherTask;
721-
Assert.True(false, "Expected exception not thrown.");
721+
Assert.Fail("Expected exception not thrown.");
722722
}
723723
catch (OperationCanceledException ex)
724724
{
@@ -756,7 +756,7 @@ public async Task AwaitRegKeyChange_CanceledAndImmediatelyDisposed()
756756
try
757757
{
758758
await watchingTask;
759-
Assert.True(false, "Expected exception not thrown.");
759+
Assert.Fail("Expected exception not thrown.");
760760
}
761761
catch (OperationCanceledException ex)
762762
{

test/Microsoft.VisualStudio.Threading.Tests/JoinableTaskAndAsyncReaderWriterLockTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public async Task RunWithinUpgradeableReadLockThrows()
163163
try
164164
{
165165
this.asyncPump.Run(() => Task.CompletedTask);
166-
Assert.False(true, "Expected InvalidOperationException not thrown.");
166+
Assert.Fail("Expected InvalidOperationException not thrown.");
167167
}
168168
catch (InvalidOperationException)
169169
{
@@ -190,7 +190,7 @@ public async Task RunWithinWriteLockThrows()
190190
try
191191
{
192192
this.asyncPump.Run(() => Task.CompletedTask);
193-
Assert.True(false, "Expected InvalidOperationException not thrown.");
193+
Assert.Fail("Expected InvalidOperationException not thrown.");
194194
}
195195
catch (InvalidOperationException)
196196
{

0 commit comments

Comments
 (0)