如何对 Flex 应用程序进行单元测试?
Flex 是一种基于事件的客户端语言。如何模拟此类事件以允许进行单元测试?
Flex is a client-side language and based on events. How can such events be mocked to allow unit testing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 FlexUnit 和 FlexMonkey
如果您将组件写入用户界面而不是具体组件,则模拟对象就像新实现一样简单。
Take a look at FlexUnit and FlexMonkey
If you are writing your components to user Interfaces rather than concrete components, mocking objects is as simple as a new implementation.
还有 AS3 的真实模拟库。看一下本教程:
http://www.allenmanning.com/?p=7
和 Mockolate 库。我实际上使用过mock-as3,它是Mockolate的祖先。有了它,您可以创建假对象,这些对象就像虚拟外观一样,用于与您的测试无关的事情:这样您就可以专注于测试特定的代码片段(无论是否在 UI 类中),将其与其依赖项解耦。
There are also real mock libraries for AS3. Take a look at this tutorial:
http://www.allenmanning.com/?p=7
and the Mockolate library. I have actually used mock-as3, which is Mockolate's ancestor. With it you can create fake objects that act like dummy facades for things irrelevant to your testing: this way you can focus on testing a specific piece of code (be it in a UI class or not) decoupling it from its dependencies.