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;    ...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: Events | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 799 | Hits: 42

Similar Posts

  • IDCC conference in Israel – Spet. 14th more
  • Testability vs. Testing more
  • Extract Embedded Resources With An Attribute In MbUnit more
  • Structuring Unit Test Code more
  • Programming Visual CSharp 2005 more
  • Unit testing demonstrated level 300 more
  • Automated testing with .Net - an overview - level 200 more
  • TDD speeds up unit testing - level 300 more
  • Shipping NUnit more
  • Unit testing continues more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD