Skip to content

Commit 155e53a

Browse files
committed
Fixed method name
1 parent 1dc4782 commit 155e53a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/DotNext.Tests/Runtime/CompilerServices/SpawningAsyncTaskMethodBuilderTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public sealed class SpawningAsyncTaskMethodBuilderTests : Test
88
[Fact]
99
public static async Task ForkAsyncMethodWithResult()
1010
{
11-
var task = Fork(static () => Sum(40, 2, Thread.CurrentThread.ManagedThreadId));
11+
var task = InvokeAsThread(static () => Sum(40, 2, Thread.CurrentThread.ManagedThreadId));
1212

1313
Equal(42, await task);
1414

@@ -25,7 +25,7 @@ static async Task<int> Sum(int x, int y, int callerThreadId)
2525
[Fact]
2626
public static Task ForkAsyncMethodWithoutResult()
2727
{
28-
return Fork(static () => CheckThreadId(Thread.CurrentThread.ManagedThreadId));
28+
return InvokeAsThread(static () => CheckThreadId(Thread.CurrentThread.ManagedThreadId));
2929

3030
[AsyncMethodBuilder(typeof(SpawningAsyncTaskMethodBuilder))]
3131
static async Task CheckThreadId(int callerThreadId)
@@ -39,7 +39,7 @@ static async Task CheckThreadId(int callerThreadId)
3939
[Fact]
4040
public static async Task CancellationOfSpawnedMethod()
4141
{
42-
var task = Fork(static () => CheckThreadId(Thread.CurrentThread.ManagedThreadId, new(true)));
42+
var task = InvokeAsThread(static () => CheckThreadId(Thread.CurrentThread.ManagedThreadId, new(true)));
4343

4444
await task.ConfigureAwait(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.SuppressThrowing);
4545
True(task.IsCanceled);

src/DotNext.Tests/Test.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private protected static Action<T> Same<T>(T expected)
4747
where T : class
4848
=> actual => Same(expected, actual);
4949

50-
protected static TResult Fork<TResult>(Func<TResult> func, [CallerMemberName] string threadName = "")
50+
protected static TResult InvokeAsThread<TResult>(Func<TResult> func, [CallerMemberName] string threadName = "")
5151
{
5252
var state = new State<TResult>(func);
5353

src/DotNext.Tests/Threading/Leases/LeaseTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public static async Task WorkerProtectedWithLease()
132132
await using var consumer = new TestLeaseConsumer(provider);
133133
True(await consumer.TryAcquireAsync());
134134

135-
var result = await Fork(() => consumer.ExecuteAsync(Worker));
135+
var result = await InvokeAsThread(() => consumer.ExecuteAsync(Worker));
136136
Equal(42, result);
137137

138138
static async Task<int> Worker(CancellationToken token)

0 commit comments

Comments
 (0)