Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for Moq compatibility with COM interop type events #713

Merged
merged 2 commits into from
Oct 29, 2018

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Oct 29, 2018

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 rebuilding Moq.Tests.ComTypes.dll and writing unit tests against it is a means to do just that.

@stakx stakx merged commit ac4968f into devlooped:master Oct 29, 2018
@stakx stakx deleted the com-tests branch October 29, 2018 00:22
stakx added a commit to stakx/moq that referenced this pull request Nov 4, 2018
This is a follow-up to devlooped#712 and devlooped#713, where we added tests documenting
F# and COM events not being marked with the IL `specialname` flag. But
as it turns out, F# and COM *properties* are marked as `specialname`,
which we document here using unit tests. Finally, we bring back checks
for `method.IsSpecialName` for property accessor method recognition.
stakx added a commit to stakx/moq that referenced this pull request Nov 4, 2018
This is a follow-up to devlooped#712 and devlooped#713, where we added tests documenting
F# and COM events not being marked with the IL `specialname` flag. But
as it turns out, F# and COM *properties* are marked as `specialname`,
which we document here using unit tests. Finally, we bring back checks
for `method.IsSpecialName` for property accessor method recognition.
stakx added a commit to stakx/moq that referenced this pull request Nov 4, 2018
This is a follow-up to devlooped#712 and devlooped#713, where we added tests documenting
F# and COM events not being marked with the IL `specialname` flag. But
as it turns out, F# and COM *properties* are marked as `specialname`,
which we document here using unit tests. Finally, we bring back checks
for `method.IsSpecialName` for property accessor method recognition.
stakx added a commit to stakx/moq that referenced this pull request Nov 4, 2018
This is a follow-up to devlooped#712 and devlooped#713, where we added tests documenting
F# and COM events not being marked with the IL `specialname` flag. But
as it turns out, F# and COM *properties and indexer* accessor methods
are marked as `specialname`, which we document here using unit tests.
Finally, we bring back checks for `method.IsSpecialName` for property
and indexer accessor method recognition.
stakx added a commit that referenced this pull request Nov 4, 2018
This is a follow-up to #712 and #713, where we added tests documenting
F# and COM events not being marked with the IL `specialname` flag. But
as it turns out, F# and COM *properties and indexer* accessor methods
are marked as `specialname`, which we document here using unit tests.
Finally, we bring back checks for `method.IsSpecialName` for property
and indexer accessor method recognition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant