I wrote a WP7 application that stores a bit of data based on today’s date. Tomorrow when the date changes, yesterday’s data gets cleared out to start fresh. Before submitting the app to the App Hub I needed to test whether it would work as expected when the date changes. At the time, I didn’t have an actual Windows Phone 7 for testing so I used the Emulator. The testing process didn’t work out quite as I expected.
Happy Path
- Load Emulator
- Deploy app to the emulator
- Run app
- Click some buttons that store today’s data
- Change the date on the development box (assuming that is where the emulator gets its current date)
- Click the windows key to unload the app
- Return to app (which should have a different date since I changed the date on the development box)
- The app data should be empty because it is a new day
Fail
There were a few misconception to the above.
- It appears that the emulator loads today’s date when the emulator starts up, because it didn’t change when I changed the date in my development environment.
- When you click the back button it unloads the application and you lose the data stored in Isolated Storage.
Fix
Replace steps 5 & 6 in the above “Happy Path” with the following steps to effectively test the date change:
No comments:
Post a Comment