🌐 English · Русский
Thanks for your interest in the project! Here is a short guide.
- .NET SDK 10 (it can build the
net8.0/net9.0/net10.0targets). - To run the tests for every target, the .NET 8, 9 and 10 runtimes are recommended.
dotnet restore
dotnet build -c Release
dotnet test -c ReleaseRun tests for a specific target:
dotnet test -c Release -f net10.0tests/YandexMusic.Tests/Integration contains tests that hit the real API. They require a Yandex
Music OAuth token and are skipped automatically when no token is set.
- Copy
.env.exampleto.envand put your token in it:(YANDEX_MUSIC_TOKEN=your_token
.envis in.gitignore— never commit the token. You can also set theYANDEX_MUSIC_TOKENenvironment variable instead of.env.) - Run only the integration tests:
Or only the unit tests (no network):
dotnet test -c Release --filter FullyQualifiedName~Integrationdotnet test -c Release --filter FullyQualifiedName!~Integration
src/YandexMusic— the core client library.src/YandexMusic.DependencyInjection— theAddYandexMusic()DI integration.samples/YandexMusic.Player— an interactive terminal music player (TUI) example.tests/YandexMusic.Tests— unit and integration tests (xUnit; integration tests use the[IntegrationFact]attribute and run only whenYANDEX_MUSIC_TOKENis set).docs/— documentation (DocFX).
- Follow the style from
.editorconfig(dotnet formathelps). - Public methods are asynchronous and accept a
CancellationToken; useConfigureAwait(false)in library code. - Throw typed exceptions derived from
YandexMusicException(in theYandexMusicnamespace), notSystem.Exception. - NuGet package versions are managed centrally in
Directory.Packages.props. - Accompany new functionality with tests and, when needed, documentation in
docs/.
- Create a branch off
main. - Make sure
dotnet buildanddotnet testpass without errors. - Describe your change in the PR and add an entry to
CHANGELOG.md(theUnreleasedsection).
By contributing, you agree that your contribution will be distributed under the MIT license.