An Implementation of BitConverter.SingleToInt32Bits

Back in the day when I did more Java development, I used Apache’s Commons Lang regularly to do all kinds of things like string manipulations and implementing Object.equals() and Object.hashCode().

Not too long ago, I started working more with C# and the .NET Framework and I found myself wanting some of the functionality of Commons Lang for the .NET platform. The closest thing I could find was Artur Trosin’s port of the EqualsBuilder and HashCodeBuilder classes from Commons Lang to C#. Artur’s excellent port saved me a lot of work. He even provided ported unit tests, which was a nice touch.
Continue reading » An Implementation of BitConverter.SingleToInt32Bits

XtUnit Troubleshooting

I’m a big advocate of automated software testing with tools like the venerable JUnit for Java and the similar NUnit for the .NET languages such as C#.

Yesterday I was implementing some NUnit tests for a C# database access object (or DAO). If you have ever implemented such tests before you’ll probably agree with me that it’s important for your test data to be in a known and consistent state before every test run. Continue reading » XtUnit Troubleshooting