Blog Insights
How To Unit Test C# Event Handler Attachment
I recently wanted to unit test a method that assigned a delegate to an event handler. I derived a way to use Reflection for asserting that the delegate was attached. This article explains my solution. Note: If you are looking for information on C# events and delegates, I recommend you take...Test Driven Groovy: StubFor
After years of being immersed in Java development, I must admit that I got spoiled by its strong and mature ecosystem. Hence, whenever I want to pick up a new technology or programming language the following must be there: class StudentScoreService { private StudentRepository studentRepository ...Updated TDD Mantra
If you have ever practiced test driven development (TDD), then you are probably familiar with the TDD mantra – red, green, refactor. I’m a big proponent of TDD, but I think the TDD mantra is missing a fourth step. In his book that introduced me to TDD, Test Driven Development: By...Acceptance Testing presentation at Iowa Code Camp
I had the opportunity to present at the eleventh Iowa Code Camp on June 8, 2013. The title of my presentation was "Easy Acceptance Testing." The purpose of the presentation was to discuss an acceptance testing framework that Source Allies, Inc. developed for a partner while working on a large...Beanoh.NET: Spend Less Time Verifying Spring.NET contexts
Beanoh.NET, pronounced 'beanˌō dot net, is a simple open source tool for verifying your Spring.NET context. Teams that leverage Beanoh spend less time focusing on configuring Spring.NET and more time adding business value. Beanoh.NET is the .NET cousin of the Java version called Beanoh. You can install Beanoh.NET to your project...Automated Testing Strategy for Legacy Systems
Once you catch the automated testing itch you want to write test for everything. But should we use the same strategy for every piece of software? The conclusion that I've come to is no. While I'm completely committed to the practice of TDD and aggressive test coverage,...Testing Spring Wiring
One of our partners suffered from this very issue. Due to environmental constraints they could not run automated, in-container tests that would have identified misconfigured beans. After repeatedly committing stupid configuration mistakes, I decided that I would write a Spring wiring test. As I began to write this I encountered...Mock Me With Fewer Words
With Mockito 1.8.3 or higher you can significantly reduce your test code setup. Here is the code before. public class MockitoTest { private EmailFactory emailFactory; private Notifier notifier; private Emailer emailer; private Email email; @Before public void setUp(){ ...Selenium IDE - Part II
In Part I we covered All examples will use the sample site https://sites.google.com/site/example4selenium/. <li>You can verify your XPath by clicking the 'Find' button. The element will be highlighted in the browser with flashing neon green if it exists.</li> <li>If you want to select elements by position, you may want the following information....Selenium IDE - Part I
Selenium IDE is a free Firefox plugin that leverages javascript to record automated test scripts. In this first tutorial we will install Selenium IDE and create a basic test script. The next tutorial will cover more advanced topics. I primarily use Selenium IDE in three areas: <li>Click the 'Results' link.</li> <li>Right-click and...