-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
Issue with System.Reflection.Missing object passed as an argument to mocked Method #107
Comments
My proposal for fixing the issue.
InterceptorStrategies.cs
My setup code
tested, works only issue - i have to add null in setup in the place of optional argument. That is because if i don't moq will create constant matcher for "System.Reflection.Missing" which i relpace with null. |
Hi @mity1982, I was going to look into this, but I can't actually get your repro code to compile (on VS 2015, referencing Moq 4.7.63 and Microsoft.Office.Interop.Excel version 15). The compiler won't allow access to property If you are still interested in having this issue looked at, could you please provide an updated repro code that compiles without errors? |
Closing this due to inactivity. If you still want to have this looked into, just reply with repro code and we can reopen this issue. |
I am using moq with Office Interop. For some reason default value for optional argument in property Worksheet.Range, is set to System.Reflection.Missing this leads to an exception when Mocked delegate is invoked via DynamicInvoke method in
with one of the arguments set to System.Reflection.Missing.
Following code reproduces problem (might have some bug as it is converted from VB. Net).
The text was updated successfully, but these errors were encountered: