This repository contains Visual Studio test projects for functionality and load tests. The test projects are located under SilhouetteTests folder. There you can find the SilhouetteTests.sln with all projects.
Make sure Spec Flow is installed on your test machine.
In this project the configuration is driven by environment variables, same as in other projects in this repository and documented in the configuration section.
Create MyTestConfig.PS1 configuration file as in this example:
$env:Silhouette_IotHubConnectionString="HostName=yourhub.azure-devices.net;SharedAccessKeyName=hubowner;SharedAccessKey=JHMBDjasb12masbdk1289askbsd9SjfHkJSFjqwhfqq="
To set the environment variables run MyTestConfig.PS1 from Package Manager Console before running the test.
Note: If test fails due to missing connection string, close and reopen Visual Studio, immediately run MyTestConfig.PS1 and then try again to run the test.
This project expects the services to be running locally on port 80.
Create two devices in IoTHub for test, you can create the devices using Device Explorer. Devices names to create:
- e2eDevice1
- e2eDevice2
Make sure the StatemanagmentService is running locally in port 80.
In Visual Studio, open Test Explorer. If you can't find it open it from the Test menu: Test\Windows\Test explorer. There you will see a list of the existing test, to run or debug a test right click the test and run it.
This is a very simple web test. It calls the GET /v0.1/devices/{deviceId}/messages operation for a registered device name device1. To test make sure the service is running on http://localhost:80 and the sample_client_simple.js is running with device1. The test verifies the expected http return code: 200 and a valid JSON in the response body.