2016-06-25 7 views
0

間違ったディレクトリ(特にプログラムファイル)を見てnunitに問題が発生した後、私はこの答えをNUnit not looking the file in the right folderに渡しました。ディレクトリをnunitのディレクトリに移動する3.2.1

だからtestdata = TestContext.CurrentContext.TestDirectory私には私のテストプロジェクトのDebugディレクトリがあります。

私の解決策のルートディレクトリにアクセスしたいのですが(例えば、テストデータファイルがそこに保存されています)どうすればこのDebugディレクトリから戻ることができますか?

答えて

0

新しいDirectoryInfoを作成して、親ディレクトリに移動するだけです。このようなもの?

var dir = new DirectoryInfo(TestContext.CurrentContext.TestDirectory); 
var testDataDir = dir.Parent.Parent; 
関連する問題