Add tests for Moq compatibility with COM interop type events #713
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a continuation, and completion, of the previous PR (#712).
This present PR documents the second reason (apart from F# compatibility) why Moq doesn't query
method.IsSpecialName
when trying to figure out whether a method could possibly be an event accessor: this IL flag isn't necessarily (or perhaps never) set in COM interop assemblies!This requires us to have a COM interop type assembly. Instead of relying on any interop assembly that might or might not be present on the build machine, we build our own. This PR includes both a compiled interop assembly, as well as its
.idl
definition file, along with instructions on how to build the DLL from it.PS: There are possibly some more aspects to Moq compatibility with COM interop that we might want to formalize with tests in the future. Extending
ComTypes.idl
, then rebuildingMoq.Tests.ComTypes.dll
and writing unit tests against it is a means to do just that.