December 8, 2009
My Øredev presentation and the code
The code and the power point can now be found on google code (it has been there all along, but now it’s official)
Murmur of echoes, about movies, software, not xhtml and maybe flowers
The code and the power point can now be found on google code (it has been there all along, but now it’s official)
[TestMethod]
[ExpectedException(typeof(Exception))]
public void ControllerTest_DotNetMock()
{
IMock mock = new DynamicMock(typeof(IDahlexView));
IDahlexView viewMock = (IDahlexView)mock.MockInstance;
mock.Expect(“Clear”);
mock.ExpectAndThrow(“DrawGrid”, new Exception(), 11, 11, 10, 10);
mock.ExpectAndReturn(“DrawBoard”, true, new IsAnything(), 10, 10);
mock.Expect(“ShowStatus”, 1, 1, 1, 2, 0);
BoardDefinition def
= new BoardDefinition(new Size(11, 11), new Size(10, 10));
DahlexController controller
= new DahlexController(viewMock, def, new Options());
controller.StartGame();
mock.Verify();
}
Finally we see a new release of the DotNetMock framework, features in Pragmatic Unit Testing in C#. Version 0.8.0 is out now!!! After trying to use it in one of my projects (the upcoming .NET version of http://nida.se/dahlex/) I was very annoyed by the fact that ExpectNoCall method did not work, so I decided to check out the bug database, where I found that bug reported a long time ago. So I decided to try and fix some of the bug and submitted them to Griffin (http://blog.griffincaprio.com/blog/) and that resulted in the 0.8.0 release. So please check it out and let us know what you think.
See: http://blog.griffincaprio.com/ and: http://sourceforge.net/projects/dotnetmock
I have posted a new bug report on MSDN Product Feedback site. Please check it out and vote! I discovered this while evaluating the various mocking frameworks that are available. More on that soon.