Unit testing events with anonymous methods
Posted by: <Rolog>,
on 16 May 2008 |
View original | Bookmarked: 0 time(s)
For a side project, I was unit testing a class with custom events and needed a way to test those events. Anonymous methods makes unit testing of events easy. The below example is simple, but demonstrates how easy it is to unit test events with anonymous methods.
using System;
using NUnit.Framework;
namespace MyNamespace
{
public class MyBusinessObjectEventArgs : EventArgs
{
public MyBusinessObject MyBusinessObject;
...