views:

21

answers:

1

Hi,

I have a desktop application made in Flex using PureMVC multi-core and Sqlite as back-end.Now, I want to write integration tests.The proxy layer makes database calls using async method of SQLConnection.And, the result-handler throws notification.I want to test that expected values were modified in tables.Any ideas,how can this be done?

A: 

If you're asking for ways to do unit testing in Flex, I suggest checking out FlexUnit as it is the most commonly used unit testing framework for Flex.

From a conceptual stand point, basically, you need to write a method to retrieve data from the database; either part of your Unit Tests or calling your actual encapsulated application classes. Many people use Data Access Objects and Data Gateways for this purpose.

I suggest running before and after tests. Retrieve data from the database and check it's value. The run your test. Then retrieve data from the database to check the updated values. What your database call entails depends on the type of test. You may want to check for the number of records in a table or values of a specific record.

Flex's asynchronous nature makes this a little tricky.

I never thought testing database values from a UI was an area where unit testing shines, but I understand why it is necessary.

www.Flextras.com
"Flex's asynchronous nature makes this a little tricky." That is the issue I am facing.I use settimeout function to call my assert function(which checks if database has been updated).I wonder, if there is a better way to do that.
jess