We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our Contributor License Agreement (CLA) first. See our license file for more details.
Most IDEs automatically prompt you to restore the dependencies but if not, use this command:
$ dotnet restore
Building:
$ dotnet build
The tests we have are full fledged integration tests, meaning they will actually reach out to a Stream app. Hence the tests require at least two environment variables: STREAM_KEY
and STREAM_SECRET
.
To have these env vars available for the test running, you need to set up a .runsettings
file in the root of the project (don't worry, it's gitignored).
:bulb Microsoft has a super detailed documentation about .runsettings file.
It needs to look like this:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<EnvironmentVariables>
<STREAM_KEY>api_key_here</STREAM_KEY>
<STREAM_SECRET>secret_key_here</STREAM_SECRET>
</EnvironmentVariables>
</RunConfiguration>
</RunSettings>
In CLI:
$ dotnet test -s .runsettings
Go to the next section to see how to use it in IDEs.
For VS Code, the recommended extensions are:
- C# by Microsoft
- .NET Core Test Explorer by Jun Huan
Recommended settings (.vscode/settings.json
):
{
"omnisharp.testRunSettings": ".runsettings"
}
Follow Microsoft's documentation on how to set up .runsettings
file.
Follow Jetbrain's documentation on how to set up .runsettings
file.