NUnit testing asynchronous events

In my current project we are using a some asynchronous webservice method calls. The actual call are in turn encapsulated in a layer that is used by the GUI, the “ClientCommand”-layer.

However when writing tests for these method we ran into trouble…. First the NUnit-framework is not very good at handling events at all, but by using this excellent article by Peter Provost I got a nice, compact way of doing the tests.

Then it was the whole asynchronous thing, which really was hard to get by. The solution given above worked out fine as long as not any assertions went threw exceptions - but what is the use of that?

So the simple solution to the problem was to simply wait for the event to fire and be handled. This was solved by setting a bool variable (bEventHandled) and not continue with the assertions until that bool was...

Read More

Eating my mobile... and a Nanbread

Mobile

Today I might have to eat my mobile (QTek 8100) and an indian Nan-bread….

I have bet the IT-department at my customer that I would do that if the test-team has finnished their testing in one day (which is the set time).

Although they never has done that before I am still a bit nervous. It looks really big and hard to … “handle”. I’ll try to find a loophole to get me out of it… maybe if I made a replica of marispan and ate it really fast they wouldn’t know the difference.

To the right is a picture of my phonemodel… Gulp

Read More

Bicycle comeback

Today when I bicycled to work it was, as always in Sweden this season, dark. So in order to see anything I switched on my headlight on the bike.

My bike is not very good so for the third time in a short while (broken wheel, flat tire and not the headlight) something broke on the bike.

About 200 meters after the light had faded for the morning I met a guy. He had just climed a steep hill and was not in a good mood. He probably also was a person very concerned with following laws and regulations. So, in a not very friendly mood, he shouted: “Maybe a lightbulb, don’t you think?”

Of course we had passed each other before I could think of any good comeback. I laughed for while but then it has nagged me the whole day. This is the basis for a whole Seinfeld...

Read More

Get more use from NCover

This is just to good to be missed…

In my current project I have implemented an automated build process, which includes some component testing done with NUnit.

Yesterday I also added the use of NCover (http://www.ncover.org) which gives you some idea on how much that was tested. The reports from NCover is not very easily understood, don’t give you any overviews and is not easy to trace back to the code.

So, with this background my eyes was running with tears when I found NCoverExplorer. A truly great and useful utility. And good-looking to :-)

Be sure to get hold of the tool today: http://www.kiwidude.com/blog/2006/01/ncoverexplorer-debut.html

And a big thank you to the “kiwi dude”. Great stuff!

Read More

Marcus on the net

This is my first ever publication on the Internet.

I am not sure yet what to put down here but I hope that it will be meaningful, for me if not for anyother.

Today I will try to lead the future-group at my Salvation Army corps (church) after work. We are planning the activites for the corps in the future. A major rebuilding is in the planning and on the way so we also need to look over the “content” of the house.

I am so honored to be leading this team of nice and intelligent people.

So - that was the start…. Lets see where this leads.

Read More