C
C#3w ago
uffen

learning moq framework

I'm trying to get my head around the moq framework but i can't seem to understand. Anyone got some good material for me to study it
10 Replies
jcotton42
jcotton423w ago
Don’t use Moq. The dev slipped some shady shit into it a while back https://discord.com/channels/143867839282020352/276100951591616512/1138745496857489409
MODiX
MODiX3w ago
TeBeCo
New version of MOQ will cause your builds to slow down A new version of popular mocking framework MOQ now includes SponsorLink which will * slow down/pause your builds in your IDE (not CI) if you do not sponsor the project. * forced build failures if you use warn as error * possibly be a violations of GDPR by collecting pii See more about MOQ issue: https://github.com/moq/moq/issues/1372 PR: https://github.com/moq/moq/pull/1373 Read more about sponsorlink here: https://www.cazzulino.com/sponsorlink.html This is being posted as it is widely-used and widely-impacts a large set of developers. It is not the purpose of this post to assume malice or negatively portrary the maintainer(s) of MOQ. Misc: there's other packages affected under the same maintainer and it organization such as: nugetizer ThisAssembly, Moq, ...
Quoted by
<@446416451230760990> from #newsfeed (click here)
From TeBeCo
React with ❌ to remove this embed.
SG97
SG973w ago
NSubstitute could be an option
uffen
uffen3w ago
Oh okay, got any other suggestions of similar frameworks to learn?
Pobiega
Pobiega3w ago
NSubstitute it does the same thing, just with a different syntax the core idea is the same: you create a substitute or mock object of a certain interface. You then specify what a given method on that interface should return when called. lastly, you pass this object to your service under test
uffen
uffen3w ago
Thank you, i will check it out
Auger
Auger3w ago
Didn't they revert that though?
jcotton42
jcotton423w ago
The dev that made the decision, kzu, is still committing. I don’t trust them.
PixxelKick
PixxelKick3w ago
@uffen My recomendation is not used a mock library at all. Avoid mocking stuff entirely except for "on the edge" stuff. Most of which have built in easy ways to mock their data, IE HttpClient has a built in way to mock its response very easily, no library needed. Write code that doesn't need mocking. Once you get into that habit you'll find your tests become substantially easier to write too
PixxelKick
PixxelKick3w ago
No description
Want results from more Discord servers?
Add your server
More Posts
✅ .net best practices & useful patternsHi all, Looking for relevant material on the subject. Would appreciate your help. - main subjects mapping a dynamic object to an existing object and only map properties that exist in the source objI need help with patching an object in ASP Core, on my api i only send a partial data of the object when I want to enter to open my path, the click event is activatedthis is the code https://paste.ofcode.org/t3AqXpwPMuULScQt7vNkXF I do not know what to do✅ updated to Swashbuckle 6.6 from 6.4 and now my code doesn't compileI have this example from a book I'm reading about asp.net, it was working fine until I updated Swash✅ i feel like there is a really easy fix that i am missingwhy is this returning 0?✅ I might be stupid, but my score system adds two every time a collision happens instead of one.I can't figure out why. Then again, I don't know what I'm doing. I'm following a tutorial and this iplease help me understand this warninghttps://www.reddit.com/r/dotnet/s/5CSCmAlroV I have already posted the question on dotnet subreddit✅ enter the button,I need this thing very urgentlySo I have a form that has 3 buttons, each button sits in the groupbox a panel with various buttons t✅ Api request matching issuei have this method ```c public async Task<ActionResult<ApiServiceResponse<CommissionDto>>> Automatic✅ how to convert Dictionary to C# object?I have `Dictionary<string, object> map` string is property name and object is property value is it p