Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
It.IsAny
, It.IsNotNull
work for COM types
Testing a COM object's type using `IsAssignableFrom` can report false negatives. .NET might only see the generic RCW type `__ComObject` in- stead of the COM interface type. The `is` operator on the other hand appears to be performing `QueryInterface` for COM objects to get the right result. Since `is` and `Type.IsAssignableFrom` work somewhat differently (see https://stackoverflow.com/q/44368313/240733), the previous type check is left in place for all objects *except* COM objects; for those, the `is`-based check is used instead. This distinction should reduce the likelihood of introducing a breaking change.
- Loading branch information