本文介绍了来测试微软Surface应用程序的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 最近,我在做微软的Surface应用程序的一个很大的发展。我也看了一些关于这些应用程序如何进行测试。 目前我使用的单元测试(包Microsoft.VisualStudio.TestTools.UnitTesting)来测试低级别的功能单一的方法。用户界面,我与表面模拟器API测试。对于这两种方法,我总是创造相同溶液的额外项目。 但我真的不知道,如果这确实是一个不错的办法。单元测试是或多或少确定,但为用户界面的测试通过点击各种事情,并检查是否存在任何错误都或多或少受到限制。虽然这个检查是不是真的做到明确 于是我问还有没有其他的方法来测试实益曲面的应用程序? 解决方案 下面就是它的上表面团队完成:包括在表面SDK的API模拟器可以让你自动发送假触摸输入到你的应用程序。以自动化您的UI是做正确的事验证再加上WPF的自动化同行。对于从标准WPF控件派生面控制,您可以使用附带的WPF类的AutomationPeer。对于像ScatterView表面特异性控制,表面SDK包括它自己的一套的AutomationPeer类。 如果您不熟悉自动化同伴(大多数人),这里的一个很好的入门博客文章的题目是的http:// miketwo.blogspot.com/2007/03/unit-testing-wpf-controls-with.html Recently I was doing a lot of development in Microsoft Surface application's. I also read something about how these applications can be tested.Currently I'm using Unit tests (package Microsoft.VisualStudio.TestTools.UnitTesting) to test the low level functionality of single methods. The user interface I'm testing with the Surface Simulator API. For both approaches I always create a extra project in the same solution.But I'm not really sure if this is really a good approach. Unit testing is more or less ok, but the tests for the user interface are more or less limited by clicking various things and checking if there is no error. Although this checking is not really done explicitly.So I'm asking are there any other approaches to beneficially test a Surface application? 解决方案 Here's how it's done on the Surface team: The Simulator APIs included in the Surface SDK will let you automate sending fake touch input to your app. Combine that with WPF's "Automation Peers" in order to automate validation that your UI is doing the right thing. For Surface controls that are derived from standard WPF controls, you can use the AutomationPeer classes that come with WPF. For Surface-specific controls like ScatterView, the Surface SDK includes it's own set of AutomationPeer classes.If you're unfamiliar with automation peers (and most people are), here's a good introductory blog post on the topic: http://miketwo.blogspot.com/2007/03/unit-testing-wpf-controls-with.html 这篇关于来测试微软Surface应用程序的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-27 12:25