Windows Testing and Test Automation
Introduction
The Windows projects utilize xUnit.net for performing unit testing and test automation. xUnit was chosen for ease-of-integration, its functionality, and its clarity.
Requirements
Windows 10
Visual Studios 2019 Professional
Related Jira Issues
https://unity3d.atlassian.net/browse/FNSDKEXT-93
https://unity3d.atlassian.net/browse/FNSDKEXT-123
https://unity3d.atlassian.net/browse/FNSDKEXT-134
https://unity3d.atlassian.net/browse/FNSDKEXT-136
https://unity3d.atlassian.net/browse/FNSDKEXT-244
Usage
Implementing Tests
tl;dr https://xunit.net/docs/getting-started/netcore/visual-studio
Existing Projects
Basic usage of the existing testing projects requires no special setup, as they were created as xUnit test projects in the first place; review the xUnit documentation for detail-in-depth.
Creating a New Project
If a new testing project for Windows/C# needs to be created, visit the the “Getting Started” link above for a quick and simple jumping-off point.
Executing Tests
To launch a test (or suite of tests):
Open the SDK project in Visual Studio.
Open the
Test Explorer
tab at the side of the IDE.Select the test (or test suite) you would like to execute.
Click the single green arrow at the top of the tab.
(Alternative) Right-click on the test (or test suite) you would like to execute and select
Run
from the context menu.
Note that the majority of tests require a VictoR device that is available (i.e. at least one VictoR device that the Android device executing the test(s) can scan for and connect to). Bluetooth/BLE tests require the executing device (e.g. the PC running the tests) have Bluetooth connectivity; USB tests require the executing device and the VictoR device(s) to be connected via USB.
Test Explorer
tab in Visual StudioTest Explorer
tab, a test suite is selected; clicking the single green arrow at the top (second button from the left, underneath the Explorer
text) will execute all tests in the suite