The Value of Writing Unit Tests
Do unit tests make sense from a business perspective? Jean-Paul S. Boodhoo's take here. BTW, if you're doing Agile development and don't read CodeBetter, now is a great time to start.
Randomly cohesive thoughts and ramblings...
Do unit tests make sense from a business perspective? Jean-Paul S. Boodhoo's take here. BTW, if you're doing Agile development and don't read CodeBetter, now is a great time to start.
Posted at 9:24 AM 0 comments
Here's a link to the slides and sample code I used for my talk at Code Camp. And here's a link to more information about Selenium: http://www.openqa.org/selenium/
Thanks for attending!
Posted at 11:39 AM 2 comments
When you start to write a substantial number of unit tests, you may discover that your tests have quite a bit in common. For instance, if you have a CreditCard class, you may have a block of code like this in each of your tests:
Assert.AreEqual( expectedCard.Number, actualCard.Number );
Assert.AreEqual( expectedCard.FirstName, actualCard.FirstName );
Assert.AreEqual( expectedCard.MiddleName, actualCard.MiddleName );
Assert.AreEqual( expectedCard.LastName, actualCard.LastName );
Assert.AreEqual( expectedCard.ExpMonth, actualCard.ExpMonth );
Assert.AreEqual( expectedCard.ExpYear, actualCard.ExpYear );
Assert.AreEqual( expectedCard, actualCard );
public class CreditCardUtil
{
public static void AssertAreEqual( CreditCard expected, CreditCard actual )
{
Assert.AreEqual( expected.Number, actual.Number );
Assert.AreEqual( expected.FirstName, actual.FirstName );
Assert.AreEqual( expected.MiddleName, actual.MiddleName );
Assert.AreEqual( expected.LastName, actual.LastName );
Assert.AreEqual( expected.ExpMonth, actual.ExpMonth );
Assert.AreEqual( expected.ExpYear, actual.ExpYear );
}
}
Posted at 11:30 PM 0 comments
Labels: unittesting programming
Oren Eini (aka Ayende Rahien) just released the latest version of Rhino Mocks, v3.0.5. This release includes a great new syntax for record and replay that will make your tests much easier to follow. Check out the syntactic sweetness here, be impressed, then download it here.
Posted at 10:40 PM 0 comments