You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix issue with the verification of the message args array
Moq can define a valid verification expression that addresses
the array behind the _params_ keyword.
Handling this correctly with Moq.ILogger too so now
something like
```
loggerMock.VerifyLog(logger => logger.LogInformation("Processed {@position} in {Elapsed:000} ms.",
It.Is<object[]>(arg => arg != null)));
```
could be used
Closes#10
// see this Test for reference https://github.com/moq/moq4/blob/61f420f3d44527ce652883ce857fc8b3bdabafca/tests/Moq.Tests/Matchers/ParamArrayMatcherFixture.cs#L19
776
+
// Executes Moq specific code that evaluates if an object matches the description of an Expression.
777
+
// In our case we need to see if the actualArgs passed into the formatter have the specified properties as described by expectedMessageArgsExpression:
778
+
//
779
+
// var (matcher, _) = MatcherFactory.CreateMatcher(expr, actualArgsParameter);
780
+
// var isMatch = matcher.Matches(actualArgs, typeof(object[]));
777
781
778
-
// create Expression<> _ = x => x.Method(expectedMessageArgsExpression);
782
+
// MatcherFactory and Match types are internal to Moq so this goal is achieved using reflection.
779
783
//
784
+
// see this Test for reference https://github.com/moq/moq4/blob/61f420f3d44527ce652883ce857fc8b3bdabafca/tests/Moq.Tests/Matchers/ParamArrayMatcherFixture.cs#L19
780
785
786
+
// create Expression<Action<IX>> _ = x => x.Method(args);
0 commit comments