Comments (3)
Moq internals have been extensively refactored since 2017, so if you are relying on internal implementation details (which is obviously not a recommended approach) then yes, you'll have to adjust your code.
The functionality that was once located in Moq.MethodCallReturn<,>
likely still exists somewhere else (possibly in Moq.Language.Flow.NonVoidSetupPhrase<,>
and MethodCall
), but I don't remember the exact details about that particular refactoring. If you want to bypass the public API, you're basically on your own.
from moq4.
I dont see anything in the changelog mentioning a replacement or removal of this method
First of all, you probably meant a type called Moq.MethodCallReturn`2
, not Moq.MethodCallReturns'2
– the latter didn't exist in version 4.1.1309.1617, as far as I can tell.
Second, this was an internal
type and not part of the public API, which is why the changelog does not need to mention any changes to (or even the removal of) it. If you use Reflection to get at private Moq bits, you basically have no guarantee that this is going to continue working forever. If you want to be safer, use only the public API.
from moq4.
Yes looking at the package in resharper dotpeek, its called Moq.MethodCallReturn`2
This code was back in 2017 and has not being touched since, so this will require a complete rework of the unit test to be part of the public API and due to the fact there is no replacement, right?
from moq4.
Related Issues (20)
- Using 'Verify' and 'It.Is<>' with a method call inside cases the same verify the run for all invocations HOT 6
- Permanently delete all data from SponsorLink's database that has been collected during builds that included Moq (notably any version 4.20.*) HOT 18
- Stop using Moq as a guinea pig to get feedback on and develop SponsorLink HOT 105
- Support Static Abstract property HOT 1
- Community Involvement HOT 5
- Change log is not updated since version 4.18.4 HOT 3
- Mocking Blobclient.DownloadContentAsync() HOT 3
- Poll on SponsorLink HOT 1
- Should allow null references as constructor parameters. HOT 1
- The public API is still missing nullable reference type annotations HOT 1
- a minor changes to improve the readability HOT 2
- Mock verification slow with It.Is(Expression) HOT 5
- [Feature Request] Make it possible to moq concrete classes HOT 1
- Moq dependency uprev is not working as expected HOT 1
- SponsorLink Integration Makes Moq Unuasable due to PII and GDPR Requirements HOT 9
- Add the ability to compare ref argument by value HOT 1
- Cannot cast inside the Action<T> parameter of Verify method
- Wrong Setup by using String interpolation within It.Is<string> HOT 4
- Question: would it make sense to call verify all on a strict mock when the mock gets disposed?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moq4.