Syndication

News

     

Archives

Miscelaneous

Programming

Browse by Tags

All Tags » Moq (RSS)
Automocking container with Moq
I realized that I never blogged about this cool feature contributed by Slava to Moq-Contrib . Auto-mocking containers was an idea originally (IIRC) from the guys at Eleutian , later on picked up by Jeremy Miller with Rhino Mocks and StructureMap . The...

Posted by Daniel Cazzulino

Filed under: ,

Where was the stubbing part in Moq?
In my very recent previous post I said "mocking and stubbing easier than ever", but actually forgot to mention the stubbing part :S. This one is not new for users of moq-contrib , but we decided to move this to the core Moq library as we get the question...

Posted by Daniel Cazzulino

Filed under: , ,

Mocking and stubbing easier than ever with Moq 2.6
I've just released a new version of Moq which contains a few bug fixes but two extremely useful features: recursive mocks and mocked default values. Recursive mocks Quite often you have a root mock object from which other mocks should "hang" through property...

Posted by Daniel Cazzulino

Filed under: , ,

Do you really care about Stub vs Mock?
I've argued in the past that this theoretical discussion is utterly useless . In my experience you need slightly different things from your test doubles at different times and depending on the scenarios and what you care about testing in a particular...

Posted by Daniel Cazzulino

Filed under: , ,

Mocking protected members with Moq
If you're familiar with Moq , you know that it relies on lambda expressions heavily. This is very good as you get full support from intellisense and refactoring features in Visual Studio. However, it also means you're for the most part restricted to setting...

Posted by Daniel Cazzulino

Filed under: , ,

Moq 2.5 shipped: lots of good news!
Today we shipped Moq v2.5. It's been a while since RC1 (a month or so feels  so long for an open source agile project!) and we god very good feedback and suggestions for the final release. I'm pretty happy with the current drop and felt it was...

Posted by Daniel Cazzulino

Filed under: , ,

A practical example on how to mock static classes without TypeMock
WCF is the second biggest framework after ASP.NET that sooner or later forces you to use a static "context" property to do anything beyond the trivial stuff. ASP.NET has the HttpContext.Current, whereas WCF has the WebOperationContext.Current for example...

Posted by Daniel Cazzulino

Filed under: , ,

Improving MoQ to allow arrange-act-assert testing style
Today, the MoQ API lets you setup expectations and later verify them, like so: [ Fact ] public void FillingRemovesInventoryIfInStock() { //arrange/setup var order = new Order (TALISKER, 50); var mock = new Mock < IWarehouse >(); //setup - expectations...

Posted by Daniel Cazzulino

Filed under: , ,

New Moq features for mock verification and creation
I wrote before about What's wrong with the Record/Reply/Verify model for mocking frameworks , and in that context, why Moq didn't provide a mock verification functionality. Given that the project is driven by users' feedback, both internal (our own team...

Posted by Daniel Cazzulino

Filed under: ,

More Posts