Skip to content

Commit

Permalink
feat: 调整xUnit为MSTest (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
joesdu authored Sep 14, 2024
2 parents e4dd4be + d9ff687 commit eb43754
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/EasilyNET.Test.Unit/Threading/AsyncLockTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace EasilyNET.Test.Unit.Threading;
/// 测试异步锁
/// </summary>
[TestClass]
public class AsyncLockTest
public class AsyncLockTest(TestContext testContext)
{
// ReSharper disable once CollectionNeverQueried.Local
private static readonly Dictionary<string, string> _dictionary = [];
Expand All @@ -21,10 +21,10 @@ public async Task TestAsyncLock()
var asyncLock = new AsyncLock();
Parallel.For(0, 1000, Body);
var c = _dictionary.Count;
Console.WriteLine($"Counter incremented to {c}");
testContext.WriteLine($"Counter incremented to {c}");
await Task.Delay(1);
var c2 = _dictionary.Count;
Console.WriteLine($"Counter2 incremented to {c2}");
testContext.WriteLine($"Counter2 incremented to {c2}");
return;

async void Body(int i)
Expand Down

0 comments on commit eb43754

Please sign in to comment.