使用 FlexUnit 对库和 mxml 进行 Flex 单元测试

发布于 2024-09-02 05:26:40 字数 170 浏览 10 评论 0 原文

我有一些软件类(库)可以在任何 mxml 文件上运行命令。 这些类(库)包装在 SWC 文件中。此 SWC 文件可由任何示例 mxml 应用程序引用(通过添加为 SWC 文件)。 我的问题是我想使用 FlexUnit 针对我的示例 mxml 文件测试这些软件类(库)。也就是说,我应该在 mxml 文件上测试软件类运行的方法。

I have some software classes(library) to run commands on any mxml file.
These classes(library) are wrapped in a SWC file. This SWC file is referenced by any sample mxml application (by adding as SWC file).
My problem is that I want to test these software classes(library) against my sample mxml file using FlexUnit. That is, I should test methods run by software classes on the mxml file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

手长情犹 2024-09-09 05:26:40

如果您真正进行单元测试,那么您应该仅对 mxml 文件的功能进行单元测试,而不是对两者的集成进行单元测试。

设置 flexunit 来测试 mxml 文件上的函数并使用模拟库(例如 ASMock 来模拟库类然后,您可以编写脚本并断言 mxml 文件中的功能按照指定的方式运行。

如果您希望进行集成/功能测试,您可能需要使用 FlexMonkey。它将为您驱动和按下按钮,并允许您断言各种行为/属性。

If you are truly doing unit testing, then you should be unit testing the functionality of the mxml files only, and not the integration of two together.

Set up flexunit to test the functions on the mxml file and use a mocking library (like ASMock to mock the library classes. You can then script and assert that the functionality in your mxml file is behaving as specced.

If you wish to do integration/functional tests, you may want to look at using FlexMonkey. It will drive and press buttons for you and allow you to assert various behavior/properties.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文