Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update CancellationTokenParametersMustComeLastTests.cs
  • Loading branch information
Youssef1313 authored Sep 26, 2020
commit 6e0fac354e0149ce186b3f28b16531f59eec8cce
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ public Task SomeAsync(CancellationToken cancellationToken,
}");
}

[Fact]
[Fact, WorkItem(4227, "https://github.com/dotnet/roslyn-analyzers/issues/4227")]
public async Task CA1068_CallerAttributesWithOptionalCancellationToken()
{
await VerifyCS.VerifyAnalyzerAsync(@"
using System;
Expand All @@ -374,6 +374,48 @@ public Task SomeAsync(CancellationToken cancellationToken = default,
{
throw new NotImplementedException();
}
}");
}

[Fact, WorkItem(4227, "https://github.com/dotnet/roslyn-analyzers/issues/4227")]
public async Task CA1068_CallerAttributesWithOptionalCancellationToken2()
{
await VerifyCS.VerifyAnalyzerAsync(@"
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;

public class C
{
public Task SomeAsync([CallerMemberName] string memberName = """",
[CallerFilePath] string sourceFilePath = """",
[CallerLineNumber] int sourceLineNumber = 0,
CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}
}");
}

[Fact, WorkItem(4227, "https://github.com/dotnet/roslyn-analyzers/issues/4227")]
public async Task CA1068_CallerAttributesWithOptionalCancellationToken3()
{
await VerifyCS.VerifyAnalyzerAsync(@"
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;

public class C
{
public Task SomeAsync([CallerMemberName] string memberName = """",
[CallerFilePath] string sourceFilePath = """",
CancellationToken cancellationToken = default,
[CallerLineNumber] int sourceLineNumber = 0)
{
throw new NotImplementedException();
}
}");
}
}
Expand Down