Can I use FlexUnit to unit test a File Upload and delete? Are those actions good examples of unit testing?
I’m a little new to unit testing and trying to figure out what parts of my UI are suitable for unit tests.
Thanks for any helpful tips.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The actual file operations will always be executed by native classes (such as FileReference), which you should not try to unit test – that’s Adobe’s responsibility, at least until Flex has left the Apache incubator.
As a rule of thumb: Always unit test only the code you wrote yourself. You can decouple it by replacing all external dependencies with test doubles (i.e. stubs or mocks, for example using mockolate).