unit-testing - WP7 : Getting started with UnitTest Framework: XamlParseException

标签 unit-testing windows-phone-7

我想将单元测试添加到我的 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/

相关文章:

c# - 对 Web API Controller 进行单元测试

c# - Windows Phone 7 中的列表框项目

c# - 如何将对象列表从我的 MainPage.xaml 发送到另一个页面

c# - 在 C# 中更改 TextBlock 的背景颜色

android - 在 Eclipse 中使用自定义 InstrumentationTestRunner 会导致错误

database - Golang 测试,调用数据库 Prepare 应该会失败,但实际上并没有

javascript - 使用多个 Not Acceptable prop值时,为什么我的React propTypes的Jest测试会中断?

windows-phone-7 - 同时运行多个 Windows Phone 7 Emulator 实例

binding - wp7 SoundEffect 播放绑定(bind)到滚动条

c# - 奇怪的 Assembly.Load 错误尝试加载使用 C# 代码提供程序编译的程序集