-
Notifications
You must be signed in to change notification settings - Fork 301
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
Introducing Moq Wrapper (Take 2) #5699
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ot available and return a E_NOTIMPL instead.
…nd the mocking of VBA type is not functional yet due to an exception being thrown when marshaling a ITypeInfo to System.Type.
…nto MockComObjects
…Id() is just a System.__ComObject, by attempting to locate the type library, load it, and get the correct type for the specified type.
…nstance of same type by caching the types being mocked.
…k provider accordingly.
…nto MockComObjects
…ject now can expose the ComMocked interface and thus the Mock property. Remove the now unnecessary return of IUnknown for IDispatch (though we still do not get a IDispatch implementation).
…nterfaces, rather than in the default interface. This ensures that even if they used a older interface or whatever, the behavior remains the same. Moreover, we now can test using dynamic, which seems to have opposite expectations of how to bind to the member -- in COM, we bind to the default interface (e.g. IFileSystem3) but in dynamic, it binds to IFileSystem, which cause it to fail. Also added more tests to cover some of mocking setups.
… types being generated for same COM interfaces.
…into a property for more consistency with Moq's syntax. Ensure that all derived interfaces are cached to aid in pseudo type-equivalence operations.
… in constructing the mock arguments
…s useless since the type equivalence is basically borked.
…nto MockComObjects
… the types, querying service for the type library, and obtaining a type to mock. Introduce CachedTypeService to manage the cache of types created via reflection/type library APIs to ensure equivalence of types for a session lifetime. See the comments in the class for details.
…nto MockComObjects # Conflicts: # Rubberduck.Main/Root/RubberduckIoCInstaller.cs
…nto MockComObjects # Conflicts: # Rubberduck.Main/Root/RubberduckIoCInstaller.cs
…nto MockComObjects
…nto MockComObjects # Conflicts: # Rubberduck.VBEEditor/ComManagement/TypeLibs/TypeInfos.cs
…rovide unit tests. Bump to .NET 4.6.1 because ExpressiveReflection requires it.
…lection work. Add unit tests on the MoqReflection.
…to handle the Is expression and some tests. Includes forwarding the arguments to enable lambda to handle ref parameters because we cannot close a lambda with a ref parameter.
…ch got extra overloads so we need to be more specific. Fun times!
…the setup can be flawed if not executed in correct sequence. Wrote tests to assert the behaviors on how Setup works only specific values passed by ref.
…nsumers. RPS is used as a model, but subsequent PR will further encapsulate in order to only expose parser events to enable cache invalidation for type cache which must be outside the CW graph.
Merged
❌ Build Rubberduck 2.5.9.6335 failed (commit 0578b9786d by @retailcoder) |
❌ Build Rubberduck 2.5.92.6337 failed (commit fc45d1f0c6 by @retailcoder) |
✅ Build Rubberduck 2.5.92.6340 completed (commit 1918b8896a by @retailcoder) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #5699 +/- ##
=======================================
Coverage 97.58% 97.58%
=======================================
Files 4 4
Lines 413 413
Branches 28 28
=======================================
Hits 403 403
Misses 6 6
Partials 4 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR picks up where #4681 left off, fixing merge conflicts and adding support to
Verify
invocations on mocks.This PR should be merged immediately (or shortly after) the version bump to v2.5.2.
ComMock.Verify
is swallowingMockException
and invokingAssertHandler
static methods instead, to make a test pass or fail if the method is invoked.