我有一个 Metro 应用程序,并创建了一些控件。我想测试它们,但看起来测试环境不模拟 UI 流。
我想写以下测试:
[UITestMethod]
public void Template_ShouldBeDefined()
{
var c = new LoginControl();
// Attach object to UI tree
Window.Current.Content = c;
Assert.IsNotNull(c.Template);
Assert.AreEqual(typeof(LoginControl), c.Template.TargetType);
}
此测试将在 silverlight 和 wpf 中通过,但在这里没有。
有可能使它工作吗?