Added prefixing for method params that have the same name as a C# keyword
This commit is contained in:
@@ -31,6 +31,24 @@ namespace InterfaceGenerator.Tests
|
||||
_sut.VoidMethod();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VoidMethodWithKeywordParam_IsImplemented()
|
||||
{
|
||||
var method = typeof(IMethodsTestService).GetMethod(
|
||||
nameof(MethodsTestService.VoidMethodWithKeywordParam));
|
||||
|
||||
method.Should().NotBeNull();
|
||||
method.ReturnType.Should().Be(typeof(void));
|
||||
|
||||
var parameters = method.GetParameters();
|
||||
parameters.Select(x => x.ParameterType).Should().AllBeEquivalentTo(typeof(string));
|
||||
parameters.Should().HaveCount(1);
|
||||
|
||||
parameters[0].Name.Should().Be("void");
|
||||
|
||||
_sut.VoidMethodWithKeywordParam("");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VoidMethodWithParams_IsImplemented()
|
||||
{
|
||||
@@ -257,6 +275,10 @@ namespace InterfaceGenerator.Tests
|
||||
public void VoidMethodWithParams(string a, string b)
|
||||
{
|
||||
}
|
||||
|
||||
public void VoidMethodWithKeywordParam(string @void)
|
||||
{
|
||||
}
|
||||
|
||||
public void VoidMethodWithOutParam(out string a)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user