Recently, I was at a client where in a project strings had to be split from:
'FI-150 1U; FI-049-I L=20 MM;LET OP LASVORM'
Into:
'FI-150 1U''FI-049-I L=20 MM''LET OP LASVORM'
At first sight, this looks simple: Semicolon Separated Values and you are done.
Not so fast Mr Smart Alec: watch the optional spaces!
The best thing for problems like these is to start with an empty implementation that some units tests covering it.
I use DUnit for Delphi unit testing.
Unit testing should go with code coverage, but there are few Delphi code coverage articles.
I’ll get into code coverage later on, as I’m working with two of the code coverage people to get this to work nicely with Delphi 2010.
Mock objects can be a good addition to unit testing too, so in a future article, I will cover using mock objects with Delphi.





