Exercise 3: Testing the Windows Phone 7 Application

In this exercise, you will test the Windows Phone 7 application.

Task 1 – Testing the Application’s Online Functionality

In this task, you will test the Windows Phone 7 application using the Windows Phone 7 emulator in an online mode.

  1. In the WP7.SharePoint.Offline solution, select Windows Phone 7 Emulator in the deployment location dropdown list
  2. In the WP7.SharePoint.Offline solution, press F5.
  3. The Windows Phone application starts in the emulator and displays the items from the Maintenance Announcements SharePoint list.

    Figure 6

    Items from the Maintenance Announcements list

  4. Click on one of the maintenance announcements in the list to select it.
  5. The Windows Phone application displays the details for the selected maintenance announcement from the SharePoint list.
  6. Do not shut down the emulator.
  7. In Visual Studio, click the Stop Debugging button or press Shift + F5.

    Note:
    Shutting down the emulator clears Isolated Storage. Stopping the debugger does not clear Isolated Storage.

Task 2 - Testing the Application’s Offline View Functionality

In this task, you will test the offline viewing capability of the Windows Phone 7 application by removing the emulator’s network capability.

  1. In the WP7.SharePoint.Offline project, in the Properties folder, open the WMAppManifest.xml file.
  2. Locate the ID_CAP_NETWORKING Capability node.

    Figure 7

    Networking capability node

  3. Highlight the ID_CAP_NETWORKINGnode.
  4. Click the comment button located on the Visual Studio toolbars.

    Figure 8

    Visual Studio comment button

  5. The ID_CAP_NETWORKING capability node should look like this:

    Figure 9

    Networking capability line disabled with a comment

  6. Save the WMAppManifest.xml.
  7. In the WP7.SharePoint.Offline solution, press F5.
  8. The Windows Phone application starts in the emulator and displays the items from the Maintenance Announcements SharePoint list.

    Figure 10

    Windows Phone with disabled capability based on the offline status

    Notice that the page title is displayed in red and it indicates the application is offline. Removing the Network capabilities for the emulator placed the application in an offline state and the application retrieved the list data from Isolated Storage. Notice that the add icon is disabled. In this lab, we do not manage replication or synchronization.