-
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
Open
retailcoder
wants to merge
67
commits into
rubberduck-vba:next
Choose a base branch
from
retailcoder:moq
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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.
…nto MockComObjects # Conflicts: # Rubberduck.CodeAnalysis/Rubberduck.CodeAnalysis.xml # Rubberduck.VBEEditor/ComManagement/TypeLibs/TypeLibs.cs Also update the TypeLibWrapperProvider class, providing a TypeLibWrapperProviderLite version for the Main use without the CW's DI while keeping the TypeLib namespace largely private.
… was used but not as a parameter was used?!?
… to use IDispatch, which we can't return directly from managed code. However, because it's all dual, we can kind of return an IUnknown interface in its place.
…nto MockComObjects
…nto MockComObjects # Conflicts: # Rubberduck.Main/Root/RubberduckIoCInstaller.cs
…nto MockComObjects
…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.
retailcoder
changed the title
[Re-]Introducing Moq Wrapper
Introducing Moq Wrapper (Take 2)
Mar 26, 2021
Merged
MDoerner
added
the
PR-Status: Conflicting
PR can't be merged as it stands, conflicts must be resolved by the author.
label
Sep 28, 2021
Vogel612
added
the
up-for-grabs
Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
label
May 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
PR-Status: Conflicting
PR can't be merged as it stands, conflicts must be resolved by the author.
up-for-grabs
Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
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.