Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Nunit では、テストの一環として、アプリケーションを開始して、停止するよりも 1 分間実行する必要があります。次に、ファイルから結果を読み取り、値が正しいかどうかをアサートします。Process.Start("app.exe"); を使用して、アプリケーションを開始および停止できます。ただし、[テスト] 内で x 秒間実行し続ける方法がわかりません。どうすればいいですか?ありがとう
[Test] void TestFiles() { using(var process = Process.Start("app.exe")) { Thread.Sleep(1000); process.Kill(); process.WaitForExit(); } // Check your files now }