Following Test-Driven Development that is.
I've recently implemented a algorithm (A*) that required a clean interface. By clean all I want is a couple of properties and a single search method.
What I've found hard is testing the search method. It contains around five steps but I'm essentially forced to code this method in one big go which makes things hard.
Is there any advice for this?
Edit
I'm using C#. No I don't have the code at hand at the moment. My problem relies in the fact a test only passes after implementing the whole search method - rather than a step in the algorithm. I naturally refactored the code after but it was implementing I found hard.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…