Archive

Posts Tagged ‘mocking framework’

MockOf: How neat is that?

October 27th, 2010
Daniel Marbach

Are you tired of using the object property in MOQ?

Are you tired of declaring a huge amount of local variables to declare complex hierarchies?

Have a look at the new Mock.Of<T> feature in MOQ! Let’s see an example.

read more

 

.NET, Agile, Test Driven Development, Testing , ,

Mocking Adventures with NMock2: Stubs Advanced

August 11th, 2009
Urs Enzler

NMock2 is a library for assisting test driven development of .NET code by providing a dynamic mock object creation framework.

In my last post on NMock2, I introduced the new Stub feature of NMock2 and its basic usage. In the second part, we are going to have a look at the advanced possibilities of the Stub mock style:

  • Define Mock Style Of Nested Mocks
  • Define Default Values

read more

 

.NET, Software, Testing, Uncategorized , , , ,

NMock2 Documentation Now On MediaWiki

August 10th, 2009
Urs Enzler

Due to changes on sourceforge.net and its hosted applications, the documentation of NMock2 – a library for assisting test driven development of .NET code by providing a dynamic Mock Object framework for .NET interfaces and classes (virtual and abstract members of classes) – has been moved from WikiSpaces to MediaWiki.

You can check it out at http://sourceforge.net/apps/mediawiki/nmock2/index.php?title=Main_Page

 

.NET, Announcement, Software, Uncategorized , , , ,

Mocking Adventures with NMock2: Stubs

August 2nd, 2009
Urs Enzler

NMock2 is a library for assisting test driven development of .NET code by providing a dynamic mock object creation framework.

In this article, I’m going to show you the basics of the new stub feature in NMock2. Note that this feature is currently only available on the development trunk in the subversion repository at https://nmock2.svn.sourceforge.net/svnroot/nmock2/trunk. Therefore, the features discussed here may change for the next official release.

Stubs can be used in scenarios where you have to test an instance of a class (let’s call this object testee) and this testee makes calls to another object (dependency) but you simply do not care what the testee calls on the dependency because it is not relevant for your test case.

Stubs will simply ignore any calls to it and if the call has a return value then the stub provides a default value.

read more

 

.NET, Software, Testing , , , , , ,

Mockito

April 6th, 2009
Adrian Elsener

A few weeks ago, I started using Mockito. Mockito is a mocking framework for Java.

What mockito is able to do:
- mocking interfaces and abstract classes
- mocking concrete classes
- spy real objects

(http://code.google.com/p/mockito)

I liked mockito so much that I decided to present it to you…
read more

 

Java, Testing , , ,

NMock2 is fast. Really fast!

March 16th, 2009
Urs Enzler

Andrew Kazyrevich published a post containing timing comparisons of Moq, Rhino Mocks, Isolator and NMock2.

And NMock2 – although still lacking some features – is very fast compared to the competitors. Woohoo!

I’m curious how the newly introduced features (mock classes, non-strict and recursive mocks) will change in this setup. I’ll check that out as soon as I find some time :-O

If you want to check the new features (alpha!) yourself then here is the svn URL: https://nmock2.svn.sourceforge.net/svnroot/nmock2/branches/nonstrictmocks

Happy mocking!

 

.NET, Announcement, Software, Testing , , , , , ,

NMock2 Release Candidate Version 2.0 is out

February 19th, 2009
Urs Enzler

The first release candidate of version 2.0 of NMock2 – a .net dynamic mocking framework – is published.

Check it out at: sourceforge.net

You can provide feedback at: NMock2 forum

Release Notes:

  • virtual/abstract classes can now be mocked (with default or transparent mock style)
  • Stack traces of exceptions thrown in event handlers of events fired on mocks are preserved
  • Source is now on Visual Studio 2008 (target framework is still .net 2.0)
  • Events of inherited interfaces can now be fired on mocks
  • internal interfaces of signed assemblies can now be mocked (contribution of Matthias Weibel)
  • Swallowed exceptions are rethrown in VerifyAllExpectationsHaveBeenMet
 

.NET, Announcement, Software , , ,

NMock2 and the year 2009

January 17th, 2009
Urs Enzler

A short list of features that you can expect of NMock2 (.NET mocking framework) in one of the next releases:

  • mocking of classes
  • nonstrict mocks
  • detectation of swallowed exceptions
  • NMock2 ReSharper plugin for code completion
  • state full mocks

http://sourceforge.net/projects/nmock2

read more

 

.NET, Software , , ,