Path to Test Data Files for Unit Testing

You’re saying the test file’s location will differ depending on the test runner, so I assume it’s included in the project and copied together with the dll’s.

string path = AppDomain.CurrentDomain.BaseDirectory;

This will get you the folder where you’re executing the test from.

[Edit]

In Visual Studio.

Resharper -> Options -> Tools -> Unit Testing -> Run Results from: Specified Folder (or change the project output folder of your test project)

Where you can specify the folder of your test data, or relative to the specified folder.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)