1つのテストでテスト対象のアプリケーションを起動し、開いたアプリケーションを他のテストで使用したいと思います。これは、アプリケーションの起動にかなりの時間がかかり、テストごとに繰り返すとコストがかかる可能性があるためです。UIマップオブジェクトとともに初期化されるオブジェクトマップに、AUTによる単一のオブジェクトが必要です。
オブジェクトが静的であっても、異なるテスト間でオブジェクトが渡されないため、このメソッドは失敗します。この問題の解決策はありますか?
UIMap
public partial class UIMap
{
public ApplicationUnderTest _aut { get; set; }
public void AUT_Open()
{
string AUTExecutable = ConfigurationManager.AppSettings["AUTExecutable"];
_aut = ApplicationUnderTest.Launch(AUTExecutable );
}
...
}
テスト
private static UIMap map;
[TestMethod]
public void Test01()
{
...
this.UIMap.RecognitionDesigner_Open();
}
[TestMethod]
public void Test02()
{
//Do something on the UIMap that tries to use the same member variable- _aut
//in the UIMap
}