Skip to content

Commit

Permalink
Add unit test for p/invoke.
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyaoyuan committed Mar 7, 2021
1 parent b9cebc6 commit dd0807b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Analyzers/CSharp/Tests/NamingStyles/NamingStylesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1382,5 +1382,17 @@ class C : I
int [|global::I.X|] => 0;
}", new TestParameters(options: s_options.PropertyNamesArePascalCase));
}

[Fact]
[WorkItem(51727, "https://github.com/dotnet/roslyn/issues/51727")]
public async Task TestExternAsync()
{
await TestMissingInRegularAndScriptAsync(
@"
class C
{
static extern void [|some_p_invoke()|];
}", new TestParameters(options: s_options.MethodNamesArePascalCase));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -497,5 +497,14 @@ End Class",
options:=s_options.TypeParameterNamesStartWithT)
End Function

<Fact, Trait(Traits.Feature, Traits.Features.NamingStyle)>
<WorkItem(51727, "https://github.com/dotnet/roslyn/issues/51727")>
Public Async Function TestExternMethod() As Task
Await TestMissingInRegularAndScriptAsync(
"Public Class C
Declare Sub [|some_p_invoke|] Lib ""some""()
End Class",
New TestParameters(options:=s_options.MethodNamesArePascalCase))
End Function
End Class
End Namespace

0 comments on commit dd0807b

Please sign in to comment.