Using VS2010 i have a test that calls a method which runs a command line command that outputs a file.
The file is outputted to:
…\TestResults\xxxxxx 2011-02-04 09_45_46\Out
I want to test that the file got successfully written
Is there some way of referencing this path without hard coding it?
Sorry, I get you now.
You can just use the TestContext property that comes with Unit Test classes.
You have properties like ResultDirectory, TestDir, TestDeploymentDir, etc…
If you don’t have it in your TestClass, just add a public TestContext property called TestContext.
It’s best to just create a new Unit Test class and see how it’s used.