There are two types of tests for excercising the wrapper library.
First, unit tests built against mock responses should be run before every Pull Request. Use Run All via the Test Explorer in Visual Studio prior to submitting any Pull Requests. You can also configure Visual Studio to automatically run the tests after each build of the solution via Test Settings in the Test menu.
Second, manual or semi-automated tests can also be run on a per-device basis via the device specific test apps. See the following for information on running these test apps:
For Xbox One: [Using the Xbox Test App.](https://github.com/Microsoft/WindowsDevicePortalWrapper/blob/master/XboxWDPDriver.md)
# Writing Tests
Windows Device Portal Wrapper (WDPW) tests are run against mock data so that a windows device is not required to run the tests.
@@ -18,7 +28,7 @@ Windows Device Portal Wrapper (WDPW) tests are run against mock data so that a w
}
```
a. If you are writing a device specific version test then override the PlatformType, the FriendlyOperatingSystemVersion used to specify where mock files are stored/named, and the OperatingSystemVersion to be used when validating the OS’s actual version number.
a. If you are writing a device specific version test then override the PlatformType, the FriendlyOperatingSystemVersion used to specify where mock files are stored/named, and the OperatingSystemVersion to be used when validating the OS’s actual version number.
Use a custom built response object as a mock. This could set the response content to be a JSON string, return a failure response, load a response object from a custom file, etc.
6. After building the test right click on it in the test explorer and select “Debug Selected Tests” to be able to hit selected break points as it runs.
6. After building the test right click on it in the test explorer and select “Debug Selected Tests†to be able to hit selected break points as it runs.
* Device-version mock data should be added to the MockData<Device\>\\<Friendly OS Version\> directory with the Friendly OS Version parsed from the mock data’s file name.
* Device-version mock data should be added to the MockData\<Device\>\\\<Friendly OS Version\> directory with the Friendly OS Version parsed from the mock data's file name.
2. In the properties view the mock data files should have their “Copy to Output Directory” property marked as “Copy if newer.” If this is not done then the tests will be unable to find the files.
2. In the properties view the mock data files should have their "Copy to Output Directory" property marked as "Copy if newer." If this is not done then the tests will be unable to find the files.