Skip to content

Commit

Permalink
fix xunit assert discovery
Browse files Browse the repository at this point in the history
fixes #755
  • Loading branch information
SimonCropp committed Nov 24, 2023
1 parent 1b848ae commit 74f8760
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ApprovalTests/Reporters/TestFrameworks/XUnit2Reporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ public XUnit2Reporter()

protected override void InvokeEqualsMethod(Type type, string[] parameters)
{
var method = type.GetMethods().First(m => m.Name == areEqual && m.GetParameters().Count() == 2);
var method = type.GetMethods()
.First(_ =>
{
var parameterInfos = _.GetParameters();
return _.Name == areEqual &&
parameterInfos.Length == 2 &&
parameterInfos.All(_ => _.ParameterType == typeof(string));
});
method.Invoke(null, parameters);
}
}

0 comments on commit 74f8760

Please sign in to comment.