Windows Phone 8 アプリケーションに WPToolkitTestFx 単体テスト フレームワークを使用しています。Assert.Fail()
またはを実行しているときに以下のエラーが発生しますAssert.IsFalse(true)
。
タイプ 'Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException' の初回例外が Microsoft.VisualStudio.QualityTools.UnitTesting.Phone.DLL で発生しました
上記のエラーの解決策。
ここにソースコード
[TestMethod]
[Asynchronous]
[Description("Test2: Sample asynchronous test")]
public void Test2()
{
// this test executes asynchronously
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
// ... and then fails
Assert.IsFalse(true);
EnqueueTestComplete();
});
}
ありがとう、ラグー