ReSharper test runner – hidden thread exceptions

By , May 14, 2010 4:31 pm

We use the ReSharper test runner here at GojiSoft to run NUnit tests from within Visual Studio. It’s a great test runner, but doesn’t play nicely with multi-threaded components where exceptions may occur on non-test threads. Unhandled exceptions on non-test threads are hidden and tests which should fail, instead pass. Here’s a very very contrived example:

Continue reading 'ReSharper test runner – hidden thread exceptions'»

C# Coding standards using ReSharper

By , May 10, 2010 6:41 pm

Having coding standards can help improve code readability and maintenance across a team, but they can be a pain if they have to be manually followed and enforced. This article describes how we used ReSharper 5 to make applying coding standards a lot less painful.

Continue reading 'C# Coding standards using ReSharper'»

Event Sequence Unit Testing – Conclusion

By , April 27, 2010 1:25 am

A lot of the development we’ve been doing here at GojiSoft has involved event driven component development. This four part article describes how we went about developing a generalized event testing framework to more easily write unit tests that codified event firing sequences.

Continue reading 'Event Sequence Unit Testing – Conclusion'»

Event Sequence Unit Testing – Part 4

By , April 22, 2010 4:07 pm

A lot of the development we’ve been doing here at GojiSoft has involved event driven component development. This four part article describes how we went about developing a generalized event testing framework to more easily write unit tests that codified event firing sequences.

Continue reading 'Event Sequence Unit Testing – Part 4'»

Event Sequence Unit Testing – Part 3

By , April 22, 2010 4:06 pm

A lot of the development we’ve been doing here at GojiSoft has involved event driven component development. This four part article describes how we went about developing a generalized event testing framework to more easily write unit tests that codified event firing sequences.

Continue reading 'Event Sequence Unit Testing – Part 3'»

Event Sequence Unit Testing – Part 2

By , April 22, 2010 4:05 pm

A lot of the development we’ve been doing here at GojiSoft has involved event driven component development. This four part article describes how we went about developing a generalized event testing framework to more easily write unit tests that codified event firing sequences.

Continue reading 'Event Sequence Unit Testing – Part 2'»

Event Sequence Unit Testing – Part 1

By , April 22, 2010 4:04 pm

A lot of the development we’ve been doing here at GojiSoft has involved event driven component development.  We didn’t like the endless boiler plate unit test code that we had to write to unit test classes that raise events, so we came up with a few helper classes that make it effortless.  A test now looks like this:

[Test] 
public void TestEventRaisingSequence() 
{ 
      var myClass = new MyEventRaisingClass(); 
 
      Action test = () => { myClass.RaiseA(); myClass.RaiseB(); }; 

      var expectedSequence = new[] { "EventA", "EventB" }; 

      EventMonitor.Assert(test, myClass, expectedSequence); 
} 

The framework handles synchronous & asynchronous event raising, as well as property change notification (INotifyPropertyChanged).

Continue reading 'Event Sequence Unit Testing – Part 1'»