Skip to content

Commit bd4fee4

Browse files
committed
fix CA1822
1 parent 257d461 commit bd4fee4

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

tests/KubernetesClient.Tests/TaskAssert.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@ public static async Task Completed(Task task, TimeSpan timeout, string message =
2525

2626
public static async Task<T> Completed<T>(Task<T> task, TimeSpan timeout, string message = "Task timed out")
2727
{
28-
var timeoutTask =
29-
Task.Delay(
30-
TimeSpan.FromMilliseconds(1000))
31-
.ContinueWith(
32-
completedTimeoutTask =>
33-
default(T)); // Value is never returned, but we need a task of the same result type in order to use Task.WhenAny.
28+
var timeoutTask = Task.Delay(TimeSpan.FromMilliseconds(1000)).ContinueWith(completedTimeoutTask => default(T));
29+
30+
// Value is never returned, but we need a task of the same result type in order to use Task.WhenAny.
3431

3532
var completedTask = await Task.WhenAny(task, timeoutTask).ConfigureAwait(false);
3633
Assert.True(ReferenceEquals(task, completedTask), message);

tests/KubernetesClient.Tests/WatchTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class WatchTests
2727
private static readonly string MockDeletedStreamLine = BuildWatchEventStreamLine(WatchEventType.Deleted);
2828
private static readonly string MockModifiedStreamLine = BuildWatchEventStreamLine(WatchEventType.Modified);
2929
private static readonly string MockErrorStreamLine = BuildWatchEventStreamLine(WatchEventType.Error);
30-
private static readonly string MockBadStreamLine = "bad json";
30+
private const string MockBadStreamLine = "bad json";
3131
private static readonly TimeSpan TestTimeout = TimeSpan.FromSeconds(150);
3232

3333
private readonly ITestOutputHelper testOutput;

0 commit comments

Comments
 (0)