Skip to content

Commit df88b69

Browse files
committed
Fixes on review
1 parent 5eda310 commit df88b69

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

Gofer.NET.Tests/GivenARedisTaskQueue.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public async Task ItCapturesArgumentsPassedToEnqueuedDelegate()
5151
TC(() => ExceptionFunc(new Exception(), semaphoreFile), new Exception().ToString()),
5252
TC(() => ExceptionFunc(new CustomException(), semaphoreFile), new CustomException().ToString()),
5353

54-
// Cancelation Argument
55-
TC(() => CancellationFunc(default, semaphoreFile), new CancellationToken().ToString()),
54+
// Cancellation Argument
55+
TC(() => CancellationFunc(new CancellationToken(), semaphoreFile), new CancellationToken().ToString()),
5656

5757
// Integer Arguments
5858
TC(() => IntFunc(int.MaxValue, semaphoreFile), int.MaxValue.ToString()),

Gofer.NET.Tests/GivenATaskInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private void TestMethod2()
9090
Console.WriteLine(nameof(TestMethod2));
9191
}
9292

93-
private Task<string> TestMethod3(CancellationToken cancellation = default)
93+
private Task<string> TestMethod3(CancellationToken cancellation)
9494
{
9595
Console.WriteLine(nameof(TestMethod3));
9696
return Task.FromResult(nameof(TestMethod3));

Gofer.NET.Tests/TestQueueTestFixture.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static void WriteSemaphore(string semaphoreFile)
7272
WriteSemaphoreValue(semaphoreFile, SemaphoreText);
7373
}
7474

75-
public static async Task WaitForCancellationAndWriteSemaphore(string semaphoreFile, CancellationToken token = default)
75+
public static async Task WaitForCancellationAndWriteSemaphore(string semaphoreFile, CancellationToken token)
7676
{
7777
try
7878
{

Gofer.NET.Utils/ActionExtensionMethods.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Linq;
33
using System.Linq.Expressions;
44
using System.Reflection;
5-
using System.Threading;
65

76
namespace Gofer.NET.Utils
87
{
@@ -20,7 +19,7 @@ public static TaskInfo ToTaskInfo(this Expression<Action> expression)
2019
.Select(a =>
2120
{
2221
var value = ((ConstantExpression)a).Value;
23-
return value is CancellationToken ? null : value;
22+
return value;
2423
})
2524
.ToArray();
2625

@@ -41,7 +40,7 @@ public static TaskInfo ToTaskInfo<T>(this Expression<Func<T>> expression)
4140
.Select(a =>
4241
{
4342
var value = ((ConstantExpression)a).Value;
44-
return value is CancellationToken ? null : value;
43+
return value;
4544
})
4645
.ToArray();
4746

0 commit comments

Comments
 (0)