我想将单元测试添加到我的 WP7 项目中。我按照 http://smartypantscoding.com/a-cheat-sheet-for-unit-testing-silverlight-apps-on-windows-phone-7 上的教程开始了单元测试。但我无法让它运行。
我按照教程中的所有步骤创建了基本测试。
但是只要我想启动项目,Visual Studio 就会抛出一个错误:
XamlParseException 发生
找不到名称/键类型为NameConverter 的资源 [行:47 位置:24]
第 47 行指的是初始 CreateTestPage:
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
SystemTray.IsVisible = false;
Line47: var testPage = UnitTestSystem.CreateTestPage() as IMobileTestPage;
BackKeyPress += (x, xe) => xe.Cancel = testPage.NavigateBack();
(Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;
}
希望你能帮帮我!
谢谢你!
最佳答案
您可能正在使用 Jeff Willcox 的 Windows Phone 7 工具包。如果您想在新的 Windows Phone 下运行它,请尝试像我一样使用新版本的工具包。
尝试使用 Jeff Willcox 的 Windows Phone 7.5 (Mango) 工具包在此处获取:http://www.jeff.wilcox.name/2011/06/updated-ut-mango-bits/
祝你好运。
关于unit-testing - WP7 : Getting started with UnitTest Framework: XamlParseException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7882505/