December 8, 2009

My Øredev presentation and the code

Posted in Fun, TDD at 16:06 by Niklas

The code and the power point can now be found on google code (it has been there all along, but now it’s official)

May 18, 2006

Testing C# code plugin for Wordpress

Posted in TDD at 11:44 by Niklas

[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();
}

March 12, 2006

DotNetMocks 0.8.0 is out now!

Posted in TDD at 21:40 by Niklas

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

February 13, 2006

.NET Framework bug?

Posted in TDD at 22:41 by Niklas

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.