Originally posted by Robin Clark:
Are you suggesting that instead of hard-coding these values in the test cases I should put them in a separate file and read them in?
Well, perhaps not. If that's all that happens with the paths, then the actual value of the path doesn't matter. I do tend to use paths like
"/value/doesnt/matter.txt"
in tests to indicate this to a person reading the test. See, as I read your code, it seemed as though it meant that a complicated directory hierarchy needed to be set up to run the test.
In any case, if Session doesn't actually create a File out of the path, and you know that when the class is changed in the future, it still won't, then there's no reason to make the path an external parameter.
But my other point -- that the redundant strings, and the strings contained inside other strings, should be made into constants so that it's easy to see what's supposed to be equal to what -- stands.
[ February 20, 2004: Message edited by: Ernest Friedman-Hill ]