Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Costello <[email protected]>
  • Loading branch information
jgarciadelanoceda and martincostello authored Jul 17, 2024
1 parent 9fc8dbe commit cfdd5e9
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class XmlMethodInfoExtensionsTests
{
[Theory]
[ClassData(typeof(DifferentMethodsSignaturesData))]
public void DifferentMethodsSignatures_ShouldBeExpected(MethodInfo methodInfo, IEnumerable<string> expectedParameterNames, Type expectedReturnType)
public void DifferentMethodsSignatures_ShouldBeExpected(MethodInfo methodInfo, string[] expectedParameterNames, Type expectedReturnType)
{
var underlyingGenericMethod = methodInfo.GetUnderlyingGenericTypeMethod();
Assert.NotNull(underlyingGenericMethod);
Expand All @@ -23,16 +23,17 @@ public void DifferentMethodsSignatures_ShouldBeExpected(MethodInfo methodInfo, I
Assert.Equal(expectedReturnType, underlyingGenericMethod.ReturnType);
}

public class DifferentMethodsSignaturesData : TheoryData<MethodInfo, IEnumerable<string>, Type>
public class DifferentMethodsSignaturesData : TheoryData<MethodInfo, string[], Type>
{
public DifferentMethodsSignaturesData()
{
var methods = typeof(NonGenericResourceController).GetMethods()
.Where(s => s.Name == nameof(NonGenericResourceController.DifferentMethodsSignatures));
var methods = typeof(NonGenericResourceController)
.GetMethods()
.Where(s => s.Name == nameof(NonGenericResourceController.DifferentMethodsSignatures));

foreach (var method in methods)
{
Add(method, method.GetParameters().Select(p => p.Name), method.ReturnType);
Add(method, method.GetParameters().Select(p => p.Name).ToArray(), method.ReturnType);
}
}
}
Expand Down

0 comments on commit cfdd5e9

Please sign in to comment.