One of the FAQ around MSTEST is on the folders exposed by TestContext. What each of them means and which one to use when.
Below is a quick summary of the various folders and their usage.
Indicates the high level folder created for the current test run. This would have “In” and “Out” subfolders inside it.
Indicates the “Out” sub folder under the “TestRunDirectory”. This is where the items needed for the current run would be deployed prior to the test run.
If you need to refer to any of your deployed files, you should be using this variable.
Indicates the “In” subfolder under “TestrunDirectory”. This is the folder where the run level attachments and data collector files would be stored after the test run.
If you need to create temp files during the test run, you should be using this variable.
Indicates a sub folder inside “In” folder corresponding to the current test case.
For each test case in the test run, a sub folder would be created which would have the test case level data collector logs like “EventLogs”.
If you add a file to the test result using TestContext.AddResult(), the file would go under the “TestResultsDirectory” corresponding to that test case.
Hope you found it useful. if you have further questions, please post your queries.