Specifically, I\'m trying to create a unit test for a method which requires uses File.separatorChar to build paths on windows and unix. The code must run on bot
Instead of using File.separatorChar declare your service Class, let's call it PathBuilder or something. This class will have a concatPaths() method which will concatenate the two parameters (using the OS's separator char). The beauty is that you are writing this class so you can tweak it anyway you want when you unit test it.