From 75d8c09c7aa88bce965f007413499fedabe665b8 Mon Sep 17 00:00:00 2001 From: Chrison Simtian Date: Thu, 17 Jul 2025 08:26:18 +0000 Subject: [PATCH 1/6] introduce new folder layout build, src, tests --- .github/workflows/TvdbClient-Nuget-Package.yml | 4 ++-- .github/workflows/TvdbClient-Unit-Tests.yml | 4 ++-- TvdbApi.sln | 4 ++-- {TvdbClient => src/TvdbClient}/Clients/ILoginClient.cs | 0 {TvdbClient => src/TvdbClient}/Clients/ITvdbClient.cs | 0 {TvdbClient => src/TvdbClient}/Clients/Interfaces.cs | 0 {TvdbClient => src/TvdbClient}/Clients/TvdbClient.cs | 0 .../TvdbClient}/Configuration/TvdbConfiguration.cs | 0 {TvdbClient => src/TvdbClient}/Constants/TvdbConstants.cs | 0 .../TvdbClient}/Converters/DateOnlyConverter.cs | 0 .../TvdbClient}/Converters/DateTimeConverter.cs | 0 .../TvdbClient}/Converters/TimeOnlyConverter.cs | 0 {TvdbClient => src/TvdbClient}/Extensions/Bootstrapper.cs | 0 .../TvdbClient}/Extensions/DateTimeExtensions.cs | 0 .../TvdbClient}/Handlers/TokenAuthorizationHeaderHandler.cs | 0 {TvdbClient => src/TvdbClient}/Models/AbstractBaseRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/Alias.cs | 0 {TvdbClient => src/TvdbClient}/Models/ApiException.cs | 0 {TvdbClient => src/TvdbClient}/Models/ApiResponseWrapper.cs | 0 {TvdbClient => src/TvdbClient}/Models/ArtworkBaseRecord.cs | 0 .../TvdbClient}/Models/ArtworkExtendedRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/ArtworkStatus.cs | 0 {TvdbClient => src/TvdbClient}/Models/ArtworkType.cs | 0 {TvdbClient => src/TvdbClient}/Models/AwardBaseRecord.cs | 0 .../TvdbClient}/Models/AwardCategoryBaseRecord.cs | 0 .../TvdbClient}/Models/AwardCategoryExtendedRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/AwardExtendedRecord.cs | 0 .../TvdbClient}/Models/AwardNomineeBaseRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/Biography.cs | 0 {TvdbClient => src/TvdbClient}/Models/Character.cs | 0 {TvdbClient => src/TvdbClient}/Models/Companies.cs | 0 {TvdbClient => src/TvdbClient}/Models/Company.cs | 0 {TvdbClient => src/TvdbClient}/Models/CompanyRelationShip.cs | 0 {TvdbClient => src/TvdbClient}/Models/CompanyType.cs | 0 {TvdbClient => src/TvdbClient}/Models/ContentRating.cs | 0 {TvdbClient => src/TvdbClient}/Models/Country.cs | 0 {TvdbClient => src/TvdbClient}/Models/Entity.cs | 0 {TvdbClient => src/TvdbClient}/Models/EntityType.cs | 0 {TvdbClient => src/TvdbClient}/Models/EntityUpdate.cs | 0 {TvdbClient => src/TvdbClient}/Models/EpisodeBaseRecord.cs | 0 .../TvdbClient}/Models/EpisodeExtendedRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/FavoriteRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/Favorites.cs | 0 {TvdbClient => src/TvdbClient}/Models/Gender.cs | 0 {TvdbClient => src/TvdbClient}/Models/GenreBaseRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/Inspiration.cs | 0 {TvdbClient => src/TvdbClient}/Models/InspirationType.cs | 0 {TvdbClient => src/TvdbClient}/Models/Language.cs | 0 {TvdbClient => src/TvdbClient}/Models/Links.cs | 0 {TvdbClient => src/TvdbClient}/Models/ListBaseRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/ListExtendedRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/LoginRequestBody.cs | 0 {TvdbClient => src/TvdbClient}/Models/MovieBaseRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/MovieExtendedRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/ParentCompany.cs | 0 {TvdbClient => src/TvdbClient}/Models/PeopleBaseRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/PeopleExtendedRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/PeopleType.cs | 0 {TvdbClient => src/TvdbClient}/Models/ProductionCountry.cs | 0 {TvdbClient => src/TvdbClient}/Models/Race.cs | 0 {TvdbClient => src/TvdbClient}/Models/RecordInfo.cs | 0 {TvdbClient => src/TvdbClient}/Models/Release.cs | 0 {TvdbClient => src/TvdbClient}/Models/RemoteID.cs | 0 {TvdbClient => src/TvdbClient}/Models/ResponseClasses.cs | 0 .../TvdbClient}/Models/SearchByRemoteIdResult.cs | 0 {TvdbClient => src/TvdbClient}/Models/SearchResult.cs | 0 {TvdbClient => src/TvdbClient}/Models/SeasonBaseRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/SeasonExtendedRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/SeasonType.cs | 0 {TvdbClient => src/TvdbClient}/Models/SeriesAirsDays.cs | 0 {TvdbClient => src/TvdbClient}/Models/SeriesBaseRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/SeriesExtendedRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/SourceType.cs | 0 {TvdbClient => src/TvdbClient}/Models/Status.cs | 0 {TvdbClient => src/TvdbClient}/Models/StudioBaseRecord.cs | 0 {TvdbClient => src/TvdbClient}/Models/Tag.cs | 0 {TvdbClient => src/TvdbClient}/Models/TagOption.cs | 0 {TvdbClient => src/TvdbClient}/Models/TagOptionEntity.cs | 0 {TvdbClient => src/TvdbClient}/Models/Token.cs | 0 {TvdbClient => src/TvdbClient}/Models/Trailer.cs | 0 {TvdbClient => src/TvdbClient}/Models/Translation.cs | 0 {TvdbClient => src/TvdbClient}/Models/TranslationExtended.cs | 0 {TvdbClient => src/TvdbClient}/Models/TranslationSimple.cs | 0 {TvdbClient => src/TvdbClient}/Models/TvdbModels.cs | 0 {TvdbClient => src/TvdbClient}/Models/UserInfo.cs | 0 {TvdbClient => src/TvdbClient}/Provider/ITokenProvider.cs | 0 {TvdbClient => src/TvdbClient}/Provider/TvdbTokenProvider.cs | 0 {TvdbClient => src/TvdbClient}/TvdbClient.csproj | 4 ++-- {TvdbClient => src/TvdbClient}/TvdbClient.nswag | 0 {TvdbClient => src/TvdbClient}/TvdbClient.yml | 0 {TvdbClient => src/TvdbClient}/Types/EpisodesMeta.cs | 0 {TvdbClient => src/TvdbClient}/Types/MovieSort.cs | 0 {TvdbClient => src/TvdbClient}/Types/MoviesMeta.cs | 0 {TvdbClient => src/TvdbClient}/Types/PeopleMeta.cs | 0 {TvdbClient => src/TvdbClient}/Types/SeriesMeta.cs | 0 {TvdbClient => src/TvdbClient}/Types/SeriesSort.cs | 0 {TvdbClient => src/TvdbClient}/Types/SortType.cs | 0 {TvdbClient => src/TvdbClient}/Types/UpdateAction.cs | 0 {TvdbClient => src/TvdbClient}/Types/UpdateEntity.cs | 0 {TvdbClient => src/TvdbClient}/version.json | 0 .../TvdbClient.Tests}/AuthenticationUnitTests.cs | 0 .../TvdbClient.Tests}/Clients/SeriesClient.cs | 0 .../TvdbClient.Tests}/Converters/DateOnlyConverterTests.cs | 0 .../TvdbClient.Tests}/Converters/DateTimeConverterTests.cs | 0 .../TvdbClient.Tests}/Converters/TimeOnlyConverterTests.cs | 0 .../TvdbClient.Tests}/Provider/TvdbTokenProviderUnitTests.cs | 0 .../TvdbClient.Tests}/TvdbClient.Tests.csproj | 2 +- .../TvdbClient.Tests}/TvdbClientConfig.json | 0 108 files changed, 9 insertions(+), 9 deletions(-) rename {TvdbClient => src/TvdbClient}/Clients/ILoginClient.cs (100%) rename {TvdbClient => src/TvdbClient}/Clients/ITvdbClient.cs (100%) rename {TvdbClient => src/TvdbClient}/Clients/Interfaces.cs (100%) rename {TvdbClient => src/TvdbClient}/Clients/TvdbClient.cs (100%) rename {TvdbClient => src/TvdbClient}/Configuration/TvdbConfiguration.cs (100%) rename {TvdbClient => src/TvdbClient}/Constants/TvdbConstants.cs (100%) rename {TvdbClient => src/TvdbClient}/Converters/DateOnlyConverter.cs (100%) rename {TvdbClient => src/TvdbClient}/Converters/DateTimeConverter.cs (100%) rename {TvdbClient => src/TvdbClient}/Converters/TimeOnlyConverter.cs (100%) rename {TvdbClient => src/TvdbClient}/Extensions/Bootstrapper.cs (100%) rename {TvdbClient => src/TvdbClient}/Extensions/DateTimeExtensions.cs (100%) rename {TvdbClient => src/TvdbClient}/Handlers/TokenAuthorizationHeaderHandler.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/AbstractBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Alias.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ApiException.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ApiResponseWrapper.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ArtworkBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ArtworkExtendedRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ArtworkStatus.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ArtworkType.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/AwardBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/AwardCategoryBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/AwardCategoryExtendedRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/AwardExtendedRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/AwardNomineeBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Biography.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Character.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Companies.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Company.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/CompanyRelationShip.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/CompanyType.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ContentRating.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Country.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Entity.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/EntityType.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/EntityUpdate.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/EpisodeBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/EpisodeExtendedRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/FavoriteRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Favorites.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Gender.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/GenreBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Inspiration.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/InspirationType.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Language.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Links.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ListBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ListExtendedRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/LoginRequestBody.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/MovieBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/MovieExtendedRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ParentCompany.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/PeopleBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/PeopleExtendedRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/PeopleType.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ProductionCountry.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Race.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/RecordInfo.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Release.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/RemoteID.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/ResponseClasses.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/SearchByRemoteIdResult.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/SearchResult.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/SeasonBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/SeasonExtendedRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/SeasonType.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/SeriesAirsDays.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/SeriesBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/SeriesExtendedRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/SourceType.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Status.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/StudioBaseRecord.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Tag.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/TagOption.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/TagOptionEntity.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Token.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Trailer.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/Translation.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/TranslationExtended.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/TranslationSimple.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/TvdbModels.cs (100%) rename {TvdbClient => src/TvdbClient}/Models/UserInfo.cs (100%) rename {TvdbClient => src/TvdbClient}/Provider/ITokenProvider.cs (100%) rename {TvdbClient => src/TvdbClient}/Provider/TvdbTokenProvider.cs (100%) rename {TvdbClient => src/TvdbClient}/TvdbClient.csproj (92%) rename {TvdbClient => src/TvdbClient}/TvdbClient.nswag (100%) rename {TvdbClient => src/TvdbClient}/TvdbClient.yml (100%) rename {TvdbClient => src/TvdbClient}/Types/EpisodesMeta.cs (100%) rename {TvdbClient => src/TvdbClient}/Types/MovieSort.cs (100%) rename {TvdbClient => src/TvdbClient}/Types/MoviesMeta.cs (100%) rename {TvdbClient => src/TvdbClient}/Types/PeopleMeta.cs (100%) rename {TvdbClient => src/TvdbClient}/Types/SeriesMeta.cs (100%) rename {TvdbClient => src/TvdbClient}/Types/SeriesSort.cs (100%) rename {TvdbClient => src/TvdbClient}/Types/SortType.cs (100%) rename {TvdbClient => src/TvdbClient}/Types/UpdateAction.cs (100%) rename {TvdbClient => src/TvdbClient}/Types/UpdateEntity.cs (100%) rename {TvdbClient => src/TvdbClient}/version.json (100%) rename {TvdbClient.Tests => tests/TvdbClient.Tests}/AuthenticationUnitTests.cs (100%) rename {TvdbClient.Tests => tests/TvdbClient.Tests}/Clients/SeriesClient.cs (100%) rename {TvdbClient.Tests => tests/TvdbClient.Tests}/Converters/DateOnlyConverterTests.cs (100%) rename {TvdbClient.Tests => tests/TvdbClient.Tests}/Converters/DateTimeConverterTests.cs (100%) rename {TvdbClient.Tests => tests/TvdbClient.Tests}/Converters/TimeOnlyConverterTests.cs (100%) rename {TvdbClient.Tests => tests/TvdbClient.Tests}/Provider/TvdbTokenProviderUnitTests.cs (100%) rename {TvdbClient.Tests => tests/TvdbClient.Tests}/TvdbClient.Tests.csproj (92%) rename {TvdbClient.Tests => tests/TvdbClient.Tests}/TvdbClientConfig.json (100%) diff --git a/.github/workflows/TvdbClient-Nuget-Package.yml b/.github/workflows/TvdbClient-Nuget-Package.yml index cb5a906..2ba11ae 100644 --- a/.github/workflows/TvdbClient-Nuget-Package.yml +++ b/.github/workflows/TvdbClient-Nuget-Package.yml @@ -2,9 +2,9 @@ name: Publish Public Release on NuGet on: push: - paths: [ 'TvdbClient/**' ] + paths: [ 'src/**' ] pull_request: - paths: [ 'TvdbClient/**' ] + paths: [ 'src/**' ] workflow_dispatch: env: diff --git a/.github/workflows/TvdbClient-Unit-Tests.yml b/.github/workflows/TvdbClient-Unit-Tests.yml index f8b53fa..9f0c708 100644 --- a/.github/workflows/TvdbClient-Unit-Tests.yml +++ b/.github/workflows/TvdbClient-Unit-Tests.yml @@ -2,9 +2,9 @@ name: Code Coverage on: push: - paths: [ 'TvdbClient/**','TvdbClient.Tests/**' ] + paths: [ 'src/**','tests/**' ] pull_request: - paths: [ 'TvdbClient/**','TvdbClient.Tests/**' ] + paths: [ 'src/**','tests/**' ] workflow_dispatch: env: diff --git a/TvdbApi.sln b/TvdbApi.sln index be98e19..1e25a39 100644 --- a/TvdbApi.sln +++ b/TvdbApi.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.13.35617.110 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TvdbClient", "TvdbClient\TvdbClient.csproj", "{02CB1507-5FF6-9962-1A70-EC35D9E298ED}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TvdbClient", "src\TvdbClient\TvdbClient.csproj", "{02CB1507-5FF6-9962-1A70-EC35D9E298ED}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TvdbClient.Tests", "TvdbClient.Tests\TvdbClient.Tests.csproj", "{E72AACA8-0A10-E62A-E526-41B75B6E6348}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TvdbClient.Tests", "tests\TvdbClient.Tests\TvdbClient.Tests.csproj", "{E72AACA8-0A10-E62A-E526-41B75B6E6348}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" ProjectSection(SolutionItems) = preProject diff --git a/TvdbClient/Clients/ILoginClient.cs b/src/TvdbClient/Clients/ILoginClient.cs similarity index 100% rename from TvdbClient/Clients/ILoginClient.cs rename to src/TvdbClient/Clients/ILoginClient.cs diff --git a/TvdbClient/Clients/ITvdbClient.cs b/src/TvdbClient/Clients/ITvdbClient.cs similarity index 100% rename from TvdbClient/Clients/ITvdbClient.cs rename to src/TvdbClient/Clients/ITvdbClient.cs diff --git a/TvdbClient/Clients/Interfaces.cs b/src/TvdbClient/Clients/Interfaces.cs similarity index 100% rename from TvdbClient/Clients/Interfaces.cs rename to src/TvdbClient/Clients/Interfaces.cs diff --git a/TvdbClient/Clients/TvdbClient.cs b/src/TvdbClient/Clients/TvdbClient.cs similarity index 100% rename from TvdbClient/Clients/TvdbClient.cs rename to src/TvdbClient/Clients/TvdbClient.cs diff --git a/TvdbClient/Configuration/TvdbConfiguration.cs b/src/TvdbClient/Configuration/TvdbConfiguration.cs similarity index 100% rename from TvdbClient/Configuration/TvdbConfiguration.cs rename to src/TvdbClient/Configuration/TvdbConfiguration.cs diff --git a/TvdbClient/Constants/TvdbConstants.cs b/src/TvdbClient/Constants/TvdbConstants.cs similarity index 100% rename from TvdbClient/Constants/TvdbConstants.cs rename to src/TvdbClient/Constants/TvdbConstants.cs diff --git a/TvdbClient/Converters/DateOnlyConverter.cs b/src/TvdbClient/Converters/DateOnlyConverter.cs similarity index 100% rename from TvdbClient/Converters/DateOnlyConverter.cs rename to src/TvdbClient/Converters/DateOnlyConverter.cs diff --git a/TvdbClient/Converters/DateTimeConverter.cs b/src/TvdbClient/Converters/DateTimeConverter.cs similarity index 100% rename from TvdbClient/Converters/DateTimeConverter.cs rename to src/TvdbClient/Converters/DateTimeConverter.cs diff --git a/TvdbClient/Converters/TimeOnlyConverter.cs b/src/TvdbClient/Converters/TimeOnlyConverter.cs similarity index 100% rename from TvdbClient/Converters/TimeOnlyConverter.cs rename to src/TvdbClient/Converters/TimeOnlyConverter.cs diff --git a/TvdbClient/Extensions/Bootstrapper.cs b/src/TvdbClient/Extensions/Bootstrapper.cs similarity index 100% rename from TvdbClient/Extensions/Bootstrapper.cs rename to src/TvdbClient/Extensions/Bootstrapper.cs diff --git a/TvdbClient/Extensions/DateTimeExtensions.cs b/src/TvdbClient/Extensions/DateTimeExtensions.cs similarity index 100% rename from TvdbClient/Extensions/DateTimeExtensions.cs rename to src/TvdbClient/Extensions/DateTimeExtensions.cs diff --git a/TvdbClient/Handlers/TokenAuthorizationHeaderHandler.cs b/src/TvdbClient/Handlers/TokenAuthorizationHeaderHandler.cs similarity index 100% rename from TvdbClient/Handlers/TokenAuthorizationHeaderHandler.cs rename to src/TvdbClient/Handlers/TokenAuthorizationHeaderHandler.cs diff --git a/TvdbClient/Models/AbstractBaseRecord.cs b/src/TvdbClient/Models/AbstractBaseRecord.cs similarity index 100% rename from TvdbClient/Models/AbstractBaseRecord.cs rename to src/TvdbClient/Models/AbstractBaseRecord.cs diff --git a/TvdbClient/Models/Alias.cs b/src/TvdbClient/Models/Alias.cs similarity index 100% rename from TvdbClient/Models/Alias.cs rename to src/TvdbClient/Models/Alias.cs diff --git a/TvdbClient/Models/ApiException.cs b/src/TvdbClient/Models/ApiException.cs similarity index 100% rename from TvdbClient/Models/ApiException.cs rename to src/TvdbClient/Models/ApiException.cs diff --git a/TvdbClient/Models/ApiResponseWrapper.cs b/src/TvdbClient/Models/ApiResponseWrapper.cs similarity index 100% rename from TvdbClient/Models/ApiResponseWrapper.cs rename to src/TvdbClient/Models/ApiResponseWrapper.cs diff --git a/TvdbClient/Models/ArtworkBaseRecord.cs b/src/TvdbClient/Models/ArtworkBaseRecord.cs similarity index 100% rename from TvdbClient/Models/ArtworkBaseRecord.cs rename to src/TvdbClient/Models/ArtworkBaseRecord.cs diff --git a/TvdbClient/Models/ArtworkExtendedRecord.cs b/src/TvdbClient/Models/ArtworkExtendedRecord.cs similarity index 100% rename from TvdbClient/Models/ArtworkExtendedRecord.cs rename to src/TvdbClient/Models/ArtworkExtendedRecord.cs diff --git a/TvdbClient/Models/ArtworkStatus.cs b/src/TvdbClient/Models/ArtworkStatus.cs similarity index 100% rename from TvdbClient/Models/ArtworkStatus.cs rename to src/TvdbClient/Models/ArtworkStatus.cs diff --git a/TvdbClient/Models/ArtworkType.cs b/src/TvdbClient/Models/ArtworkType.cs similarity index 100% rename from TvdbClient/Models/ArtworkType.cs rename to src/TvdbClient/Models/ArtworkType.cs diff --git a/TvdbClient/Models/AwardBaseRecord.cs b/src/TvdbClient/Models/AwardBaseRecord.cs similarity index 100% rename from TvdbClient/Models/AwardBaseRecord.cs rename to src/TvdbClient/Models/AwardBaseRecord.cs diff --git a/TvdbClient/Models/AwardCategoryBaseRecord.cs b/src/TvdbClient/Models/AwardCategoryBaseRecord.cs similarity index 100% rename from TvdbClient/Models/AwardCategoryBaseRecord.cs rename to src/TvdbClient/Models/AwardCategoryBaseRecord.cs diff --git a/TvdbClient/Models/AwardCategoryExtendedRecord.cs b/src/TvdbClient/Models/AwardCategoryExtendedRecord.cs similarity index 100% rename from TvdbClient/Models/AwardCategoryExtendedRecord.cs rename to src/TvdbClient/Models/AwardCategoryExtendedRecord.cs diff --git a/TvdbClient/Models/AwardExtendedRecord.cs b/src/TvdbClient/Models/AwardExtendedRecord.cs similarity index 100% rename from TvdbClient/Models/AwardExtendedRecord.cs rename to src/TvdbClient/Models/AwardExtendedRecord.cs diff --git a/TvdbClient/Models/AwardNomineeBaseRecord.cs b/src/TvdbClient/Models/AwardNomineeBaseRecord.cs similarity index 100% rename from TvdbClient/Models/AwardNomineeBaseRecord.cs rename to src/TvdbClient/Models/AwardNomineeBaseRecord.cs diff --git a/TvdbClient/Models/Biography.cs b/src/TvdbClient/Models/Biography.cs similarity index 100% rename from TvdbClient/Models/Biography.cs rename to src/TvdbClient/Models/Biography.cs diff --git a/TvdbClient/Models/Character.cs b/src/TvdbClient/Models/Character.cs similarity index 100% rename from TvdbClient/Models/Character.cs rename to src/TvdbClient/Models/Character.cs diff --git a/TvdbClient/Models/Companies.cs b/src/TvdbClient/Models/Companies.cs similarity index 100% rename from TvdbClient/Models/Companies.cs rename to src/TvdbClient/Models/Companies.cs diff --git a/TvdbClient/Models/Company.cs b/src/TvdbClient/Models/Company.cs similarity index 100% rename from TvdbClient/Models/Company.cs rename to src/TvdbClient/Models/Company.cs diff --git a/TvdbClient/Models/CompanyRelationShip.cs b/src/TvdbClient/Models/CompanyRelationShip.cs similarity index 100% rename from TvdbClient/Models/CompanyRelationShip.cs rename to src/TvdbClient/Models/CompanyRelationShip.cs diff --git a/TvdbClient/Models/CompanyType.cs b/src/TvdbClient/Models/CompanyType.cs similarity index 100% rename from TvdbClient/Models/CompanyType.cs rename to src/TvdbClient/Models/CompanyType.cs diff --git a/TvdbClient/Models/ContentRating.cs b/src/TvdbClient/Models/ContentRating.cs similarity index 100% rename from TvdbClient/Models/ContentRating.cs rename to src/TvdbClient/Models/ContentRating.cs diff --git a/TvdbClient/Models/Country.cs b/src/TvdbClient/Models/Country.cs similarity index 100% rename from TvdbClient/Models/Country.cs rename to src/TvdbClient/Models/Country.cs diff --git a/TvdbClient/Models/Entity.cs b/src/TvdbClient/Models/Entity.cs similarity index 100% rename from TvdbClient/Models/Entity.cs rename to src/TvdbClient/Models/Entity.cs diff --git a/TvdbClient/Models/EntityType.cs b/src/TvdbClient/Models/EntityType.cs similarity index 100% rename from TvdbClient/Models/EntityType.cs rename to src/TvdbClient/Models/EntityType.cs diff --git a/TvdbClient/Models/EntityUpdate.cs b/src/TvdbClient/Models/EntityUpdate.cs similarity index 100% rename from TvdbClient/Models/EntityUpdate.cs rename to src/TvdbClient/Models/EntityUpdate.cs diff --git a/TvdbClient/Models/EpisodeBaseRecord.cs b/src/TvdbClient/Models/EpisodeBaseRecord.cs similarity index 100% rename from TvdbClient/Models/EpisodeBaseRecord.cs rename to src/TvdbClient/Models/EpisodeBaseRecord.cs diff --git a/TvdbClient/Models/EpisodeExtendedRecord.cs b/src/TvdbClient/Models/EpisodeExtendedRecord.cs similarity index 100% rename from TvdbClient/Models/EpisodeExtendedRecord.cs rename to src/TvdbClient/Models/EpisodeExtendedRecord.cs diff --git a/TvdbClient/Models/FavoriteRecord.cs b/src/TvdbClient/Models/FavoriteRecord.cs similarity index 100% rename from TvdbClient/Models/FavoriteRecord.cs rename to src/TvdbClient/Models/FavoriteRecord.cs diff --git a/TvdbClient/Models/Favorites.cs b/src/TvdbClient/Models/Favorites.cs similarity index 100% rename from TvdbClient/Models/Favorites.cs rename to src/TvdbClient/Models/Favorites.cs diff --git a/TvdbClient/Models/Gender.cs b/src/TvdbClient/Models/Gender.cs similarity index 100% rename from TvdbClient/Models/Gender.cs rename to src/TvdbClient/Models/Gender.cs diff --git a/TvdbClient/Models/GenreBaseRecord.cs b/src/TvdbClient/Models/GenreBaseRecord.cs similarity index 100% rename from TvdbClient/Models/GenreBaseRecord.cs rename to src/TvdbClient/Models/GenreBaseRecord.cs diff --git a/TvdbClient/Models/Inspiration.cs b/src/TvdbClient/Models/Inspiration.cs similarity index 100% rename from TvdbClient/Models/Inspiration.cs rename to src/TvdbClient/Models/Inspiration.cs diff --git a/TvdbClient/Models/InspirationType.cs b/src/TvdbClient/Models/InspirationType.cs similarity index 100% rename from TvdbClient/Models/InspirationType.cs rename to src/TvdbClient/Models/InspirationType.cs diff --git a/TvdbClient/Models/Language.cs b/src/TvdbClient/Models/Language.cs similarity index 100% rename from TvdbClient/Models/Language.cs rename to src/TvdbClient/Models/Language.cs diff --git a/TvdbClient/Models/Links.cs b/src/TvdbClient/Models/Links.cs similarity index 100% rename from TvdbClient/Models/Links.cs rename to src/TvdbClient/Models/Links.cs diff --git a/TvdbClient/Models/ListBaseRecord.cs b/src/TvdbClient/Models/ListBaseRecord.cs similarity index 100% rename from TvdbClient/Models/ListBaseRecord.cs rename to src/TvdbClient/Models/ListBaseRecord.cs diff --git a/TvdbClient/Models/ListExtendedRecord.cs b/src/TvdbClient/Models/ListExtendedRecord.cs similarity index 100% rename from TvdbClient/Models/ListExtendedRecord.cs rename to src/TvdbClient/Models/ListExtendedRecord.cs diff --git a/TvdbClient/Models/LoginRequestBody.cs b/src/TvdbClient/Models/LoginRequestBody.cs similarity index 100% rename from TvdbClient/Models/LoginRequestBody.cs rename to src/TvdbClient/Models/LoginRequestBody.cs diff --git a/TvdbClient/Models/MovieBaseRecord.cs b/src/TvdbClient/Models/MovieBaseRecord.cs similarity index 100% rename from TvdbClient/Models/MovieBaseRecord.cs rename to src/TvdbClient/Models/MovieBaseRecord.cs diff --git a/TvdbClient/Models/MovieExtendedRecord.cs b/src/TvdbClient/Models/MovieExtendedRecord.cs similarity index 100% rename from TvdbClient/Models/MovieExtendedRecord.cs rename to src/TvdbClient/Models/MovieExtendedRecord.cs diff --git a/TvdbClient/Models/ParentCompany.cs b/src/TvdbClient/Models/ParentCompany.cs similarity index 100% rename from TvdbClient/Models/ParentCompany.cs rename to src/TvdbClient/Models/ParentCompany.cs diff --git a/TvdbClient/Models/PeopleBaseRecord.cs b/src/TvdbClient/Models/PeopleBaseRecord.cs similarity index 100% rename from TvdbClient/Models/PeopleBaseRecord.cs rename to src/TvdbClient/Models/PeopleBaseRecord.cs diff --git a/TvdbClient/Models/PeopleExtendedRecord.cs b/src/TvdbClient/Models/PeopleExtendedRecord.cs similarity index 100% rename from TvdbClient/Models/PeopleExtendedRecord.cs rename to src/TvdbClient/Models/PeopleExtendedRecord.cs diff --git a/TvdbClient/Models/PeopleType.cs b/src/TvdbClient/Models/PeopleType.cs similarity index 100% rename from TvdbClient/Models/PeopleType.cs rename to src/TvdbClient/Models/PeopleType.cs diff --git a/TvdbClient/Models/ProductionCountry.cs b/src/TvdbClient/Models/ProductionCountry.cs similarity index 100% rename from TvdbClient/Models/ProductionCountry.cs rename to src/TvdbClient/Models/ProductionCountry.cs diff --git a/TvdbClient/Models/Race.cs b/src/TvdbClient/Models/Race.cs similarity index 100% rename from TvdbClient/Models/Race.cs rename to src/TvdbClient/Models/Race.cs diff --git a/TvdbClient/Models/RecordInfo.cs b/src/TvdbClient/Models/RecordInfo.cs similarity index 100% rename from TvdbClient/Models/RecordInfo.cs rename to src/TvdbClient/Models/RecordInfo.cs diff --git a/TvdbClient/Models/Release.cs b/src/TvdbClient/Models/Release.cs similarity index 100% rename from TvdbClient/Models/Release.cs rename to src/TvdbClient/Models/Release.cs diff --git a/TvdbClient/Models/RemoteID.cs b/src/TvdbClient/Models/RemoteID.cs similarity index 100% rename from TvdbClient/Models/RemoteID.cs rename to src/TvdbClient/Models/RemoteID.cs diff --git a/TvdbClient/Models/ResponseClasses.cs b/src/TvdbClient/Models/ResponseClasses.cs similarity index 100% rename from TvdbClient/Models/ResponseClasses.cs rename to src/TvdbClient/Models/ResponseClasses.cs diff --git a/TvdbClient/Models/SearchByRemoteIdResult.cs b/src/TvdbClient/Models/SearchByRemoteIdResult.cs similarity index 100% rename from TvdbClient/Models/SearchByRemoteIdResult.cs rename to src/TvdbClient/Models/SearchByRemoteIdResult.cs diff --git a/TvdbClient/Models/SearchResult.cs b/src/TvdbClient/Models/SearchResult.cs similarity index 100% rename from TvdbClient/Models/SearchResult.cs rename to src/TvdbClient/Models/SearchResult.cs diff --git a/TvdbClient/Models/SeasonBaseRecord.cs b/src/TvdbClient/Models/SeasonBaseRecord.cs similarity index 100% rename from TvdbClient/Models/SeasonBaseRecord.cs rename to src/TvdbClient/Models/SeasonBaseRecord.cs diff --git a/TvdbClient/Models/SeasonExtendedRecord.cs b/src/TvdbClient/Models/SeasonExtendedRecord.cs similarity index 100% rename from TvdbClient/Models/SeasonExtendedRecord.cs rename to src/TvdbClient/Models/SeasonExtendedRecord.cs diff --git a/TvdbClient/Models/SeasonType.cs b/src/TvdbClient/Models/SeasonType.cs similarity index 100% rename from TvdbClient/Models/SeasonType.cs rename to src/TvdbClient/Models/SeasonType.cs diff --git a/TvdbClient/Models/SeriesAirsDays.cs b/src/TvdbClient/Models/SeriesAirsDays.cs similarity index 100% rename from TvdbClient/Models/SeriesAirsDays.cs rename to src/TvdbClient/Models/SeriesAirsDays.cs diff --git a/TvdbClient/Models/SeriesBaseRecord.cs b/src/TvdbClient/Models/SeriesBaseRecord.cs similarity index 100% rename from TvdbClient/Models/SeriesBaseRecord.cs rename to src/TvdbClient/Models/SeriesBaseRecord.cs diff --git a/TvdbClient/Models/SeriesExtendedRecord.cs b/src/TvdbClient/Models/SeriesExtendedRecord.cs similarity index 100% rename from TvdbClient/Models/SeriesExtendedRecord.cs rename to src/TvdbClient/Models/SeriesExtendedRecord.cs diff --git a/TvdbClient/Models/SourceType.cs b/src/TvdbClient/Models/SourceType.cs similarity index 100% rename from TvdbClient/Models/SourceType.cs rename to src/TvdbClient/Models/SourceType.cs diff --git a/TvdbClient/Models/Status.cs b/src/TvdbClient/Models/Status.cs similarity index 100% rename from TvdbClient/Models/Status.cs rename to src/TvdbClient/Models/Status.cs diff --git a/TvdbClient/Models/StudioBaseRecord.cs b/src/TvdbClient/Models/StudioBaseRecord.cs similarity index 100% rename from TvdbClient/Models/StudioBaseRecord.cs rename to src/TvdbClient/Models/StudioBaseRecord.cs diff --git a/TvdbClient/Models/Tag.cs b/src/TvdbClient/Models/Tag.cs similarity index 100% rename from TvdbClient/Models/Tag.cs rename to src/TvdbClient/Models/Tag.cs diff --git a/TvdbClient/Models/TagOption.cs b/src/TvdbClient/Models/TagOption.cs similarity index 100% rename from TvdbClient/Models/TagOption.cs rename to src/TvdbClient/Models/TagOption.cs diff --git a/TvdbClient/Models/TagOptionEntity.cs b/src/TvdbClient/Models/TagOptionEntity.cs similarity index 100% rename from TvdbClient/Models/TagOptionEntity.cs rename to src/TvdbClient/Models/TagOptionEntity.cs diff --git a/TvdbClient/Models/Token.cs b/src/TvdbClient/Models/Token.cs similarity index 100% rename from TvdbClient/Models/Token.cs rename to src/TvdbClient/Models/Token.cs diff --git a/TvdbClient/Models/Trailer.cs b/src/TvdbClient/Models/Trailer.cs similarity index 100% rename from TvdbClient/Models/Trailer.cs rename to src/TvdbClient/Models/Trailer.cs diff --git a/TvdbClient/Models/Translation.cs b/src/TvdbClient/Models/Translation.cs similarity index 100% rename from TvdbClient/Models/Translation.cs rename to src/TvdbClient/Models/Translation.cs diff --git a/TvdbClient/Models/TranslationExtended.cs b/src/TvdbClient/Models/TranslationExtended.cs similarity index 100% rename from TvdbClient/Models/TranslationExtended.cs rename to src/TvdbClient/Models/TranslationExtended.cs diff --git a/TvdbClient/Models/TranslationSimple.cs b/src/TvdbClient/Models/TranslationSimple.cs similarity index 100% rename from TvdbClient/Models/TranslationSimple.cs rename to src/TvdbClient/Models/TranslationSimple.cs diff --git a/TvdbClient/Models/TvdbModels.cs b/src/TvdbClient/Models/TvdbModels.cs similarity index 100% rename from TvdbClient/Models/TvdbModels.cs rename to src/TvdbClient/Models/TvdbModels.cs diff --git a/TvdbClient/Models/UserInfo.cs b/src/TvdbClient/Models/UserInfo.cs similarity index 100% rename from TvdbClient/Models/UserInfo.cs rename to src/TvdbClient/Models/UserInfo.cs diff --git a/TvdbClient/Provider/ITokenProvider.cs b/src/TvdbClient/Provider/ITokenProvider.cs similarity index 100% rename from TvdbClient/Provider/ITokenProvider.cs rename to src/TvdbClient/Provider/ITokenProvider.cs diff --git a/TvdbClient/Provider/TvdbTokenProvider.cs b/src/TvdbClient/Provider/TvdbTokenProvider.cs similarity index 100% rename from TvdbClient/Provider/TvdbTokenProvider.cs rename to src/TvdbClient/Provider/TvdbTokenProvider.cs diff --git a/TvdbClient/TvdbClient.csproj b/src/TvdbClient/TvdbClient.csproj similarity index 92% rename from TvdbClient/TvdbClient.csproj rename to src/TvdbClient/TvdbClient.csproj index e269359..ff96d83 100644 --- a/TvdbClient/TvdbClient.csproj +++ b/src/TvdbClient/TvdbClient.csproj @@ -39,8 +39,8 @@ - - + + diff --git a/TvdbClient/TvdbClient.nswag b/src/TvdbClient/TvdbClient.nswag similarity index 100% rename from TvdbClient/TvdbClient.nswag rename to src/TvdbClient/TvdbClient.nswag diff --git a/TvdbClient/TvdbClient.yml b/src/TvdbClient/TvdbClient.yml similarity index 100% rename from TvdbClient/TvdbClient.yml rename to src/TvdbClient/TvdbClient.yml diff --git a/TvdbClient/Types/EpisodesMeta.cs b/src/TvdbClient/Types/EpisodesMeta.cs similarity index 100% rename from TvdbClient/Types/EpisodesMeta.cs rename to src/TvdbClient/Types/EpisodesMeta.cs diff --git a/TvdbClient/Types/MovieSort.cs b/src/TvdbClient/Types/MovieSort.cs similarity index 100% rename from TvdbClient/Types/MovieSort.cs rename to src/TvdbClient/Types/MovieSort.cs diff --git a/TvdbClient/Types/MoviesMeta.cs b/src/TvdbClient/Types/MoviesMeta.cs similarity index 100% rename from TvdbClient/Types/MoviesMeta.cs rename to src/TvdbClient/Types/MoviesMeta.cs diff --git a/TvdbClient/Types/PeopleMeta.cs b/src/TvdbClient/Types/PeopleMeta.cs similarity index 100% rename from TvdbClient/Types/PeopleMeta.cs rename to src/TvdbClient/Types/PeopleMeta.cs diff --git a/TvdbClient/Types/SeriesMeta.cs b/src/TvdbClient/Types/SeriesMeta.cs similarity index 100% rename from TvdbClient/Types/SeriesMeta.cs rename to src/TvdbClient/Types/SeriesMeta.cs diff --git a/TvdbClient/Types/SeriesSort.cs b/src/TvdbClient/Types/SeriesSort.cs similarity index 100% rename from TvdbClient/Types/SeriesSort.cs rename to src/TvdbClient/Types/SeriesSort.cs diff --git a/TvdbClient/Types/SortType.cs b/src/TvdbClient/Types/SortType.cs similarity index 100% rename from TvdbClient/Types/SortType.cs rename to src/TvdbClient/Types/SortType.cs diff --git a/TvdbClient/Types/UpdateAction.cs b/src/TvdbClient/Types/UpdateAction.cs similarity index 100% rename from TvdbClient/Types/UpdateAction.cs rename to src/TvdbClient/Types/UpdateAction.cs diff --git a/TvdbClient/Types/UpdateEntity.cs b/src/TvdbClient/Types/UpdateEntity.cs similarity index 100% rename from TvdbClient/Types/UpdateEntity.cs rename to src/TvdbClient/Types/UpdateEntity.cs diff --git a/TvdbClient/version.json b/src/TvdbClient/version.json similarity index 100% rename from TvdbClient/version.json rename to src/TvdbClient/version.json diff --git a/TvdbClient.Tests/AuthenticationUnitTests.cs b/tests/TvdbClient.Tests/AuthenticationUnitTests.cs similarity index 100% rename from TvdbClient.Tests/AuthenticationUnitTests.cs rename to tests/TvdbClient.Tests/AuthenticationUnitTests.cs diff --git a/TvdbClient.Tests/Clients/SeriesClient.cs b/tests/TvdbClient.Tests/Clients/SeriesClient.cs similarity index 100% rename from TvdbClient.Tests/Clients/SeriesClient.cs rename to tests/TvdbClient.Tests/Clients/SeriesClient.cs diff --git a/TvdbClient.Tests/Converters/DateOnlyConverterTests.cs b/tests/TvdbClient.Tests/Converters/DateOnlyConverterTests.cs similarity index 100% rename from TvdbClient.Tests/Converters/DateOnlyConverterTests.cs rename to tests/TvdbClient.Tests/Converters/DateOnlyConverterTests.cs diff --git a/TvdbClient.Tests/Converters/DateTimeConverterTests.cs b/tests/TvdbClient.Tests/Converters/DateTimeConverterTests.cs similarity index 100% rename from TvdbClient.Tests/Converters/DateTimeConverterTests.cs rename to tests/TvdbClient.Tests/Converters/DateTimeConverterTests.cs diff --git a/TvdbClient.Tests/Converters/TimeOnlyConverterTests.cs b/tests/TvdbClient.Tests/Converters/TimeOnlyConverterTests.cs similarity index 100% rename from TvdbClient.Tests/Converters/TimeOnlyConverterTests.cs rename to tests/TvdbClient.Tests/Converters/TimeOnlyConverterTests.cs diff --git a/TvdbClient.Tests/Provider/TvdbTokenProviderUnitTests.cs b/tests/TvdbClient.Tests/Provider/TvdbTokenProviderUnitTests.cs similarity index 100% rename from TvdbClient.Tests/Provider/TvdbTokenProviderUnitTests.cs rename to tests/TvdbClient.Tests/Provider/TvdbTokenProviderUnitTests.cs diff --git a/TvdbClient.Tests/TvdbClient.Tests.csproj b/tests/TvdbClient.Tests/TvdbClient.Tests.csproj similarity index 92% rename from TvdbClient.Tests/TvdbClient.Tests.csproj rename to tests/TvdbClient.Tests/TvdbClient.Tests.csproj index 6ab9e11..1a95a96 100644 --- a/TvdbClient.Tests/TvdbClient.Tests.csproj +++ b/tests/TvdbClient.Tests/TvdbClient.Tests.csproj @@ -44,7 +44,7 @@ - + diff --git a/TvdbClient.Tests/TvdbClientConfig.json b/tests/TvdbClient.Tests/TvdbClientConfig.json similarity index 100% rename from TvdbClient.Tests/TvdbClientConfig.json rename to tests/TvdbClient.Tests/TvdbClientConfig.json From 54e6daf4ccd8531ef4166e59bd3f1e77094729ba Mon Sep 17 00:00:00 2001 From: Chrison Simtian Date: Sun, 20 Jul 2025 11:47:08 +1200 Subject: [PATCH 2/6] make md linter happy --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bc0c10b..78cfdeb 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,22 @@ # TvdbApi + C# Api Client for the TVDB project ## TVDB Project + - [TVDB API](https://thetvdb.com) - [TVDB API Github](https://github.com/thetvdb/v4-api) - [TVDB API Documentation](https://thetvdb.github.io/v4-api) ## Usage + The TVDB Team recommends to maintain your own copy of their database or use a caching proxy to reduce the amount of calls being made against their API. It is entirely up to you as the developer to implement this. This lbirary provides a simple API client AS IS, without any of the recommended caching mechanism. ### Configuration + The Client library relies on config records being present in either your appsettings.json or in a standalone TvdbClientConfig.json: + ```json { "TvdbConfiguration": { @@ -22,9 +27,11 @@ The Client library relies on config records being present in either your appsett } } ``` + Make sure to replace the API Key in the example with your own API Key in [TVDBs API Key Dashboard](https://www.thetvdb.com/dashboard/account/apikey). ### DI Registration + Register TVDB Client with your DI of choice: ```csharp @@ -33,6 +40,7 @@ Register TVDB Client with your DI of choice: ``` ### Using the Clients + ```csharp var client = serviceProvider.GetRequiredService(); var series = await client.GetSeriesAsync(121361); @@ -40,4 +48,5 @@ Register TVDB Client with your DI of choice: ``` ## Versioning -I try my best to align the version of this library to the latest TVDB version on their Github repository to make it easy to see which version this client is compatible with. \ No newline at end of file + +I try my best to align the version of this library to the latest TVDB version on their Github repository to make it easy to see which version this client is compatible with. From 3b89e02c3c587c85437d1859d199c3a590f3c2dc Mon Sep 17 00:00:00 2001 From: Chrison Simtian Date: Sun, 20 Jul 2025 11:53:16 +1200 Subject: [PATCH 3/6] fix path in unit tests --- .github/workflows/TvdbClient-Unit-Tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TvdbClient-Unit-Tests.yml b/.github/workflows/TvdbClient-Unit-Tests.yml index 9f0c708..31fbeff 100644 --- a/.github/workflows/TvdbClient-Unit-Tests.yml +++ b/.github/workflows/TvdbClient-Unit-Tests.yml @@ -35,7 +35,7 @@ jobs: run: dotnet build --no-restore - name: Run tests with coverage - run: dotnet test ${{env.PROJECT_NAME}}/${{env.PROJECT_NAME}}.csproj --no-build --collect:"XPlat Code Coverage" #-p:CollectCoverage=true -p:CoverletOutputFormat=opencover + run: dotnet test tests/${{env.PROJECT_NAME}}/${{env.PROJECT_NAME}}.csproj --no-build --collect:"XPlat Code Coverage" #-p:CollectCoverage=true -p:CoverletOutputFormat=opencover continue-on-error: true - name: Upload coverage report From b0a2f216f63dce9419b3dd5a0eab32ace63dc2e3 Mon Sep 17 00:00:00 2001 From: Chrison Simtian Date: Sun, 20 Jul 2025 12:42:54 +1200 Subject: [PATCH 4/6] introduce build props and migrate from xunit to tunit --- Directory.Build.props | 11 +- TvdbApi.sln | 14 +++ src/Directory.Build.props | 17 +++ src/TvdbClient/TvdbClient.csproj | 24 ---- tests/Directory.Build.props | 18 +++ .../AuthenticationUnitTests.cs | 12 +- .../TvdbClient.Tests/Clients/SeriesClient.cs | 17 +-- .../Converters/DateOnlyConverterTests.cs | 108 ++++++++--------- .../Converters/DateTimeConverterTests.cs | 103 ++++++++-------- .../Converters/TimeOnlyConverterTests.cs | 110 +++++++++--------- .../Provider/TvdbTokenProviderUnitTests.cs | 9 +- .../TvdbClient.Tests/TvdbClient.Tests.csproj | 19 +-- 12 files changed, 235 insertions(+), 227 deletions(-) create mode 100644 src/Directory.Build.props create mode 100644 tests/Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props index 26886e4..fe6a208 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,9 +1,18 @@  - + + net9.0 + Tvdb + enable + enable + + all 3.7.115 + + $([System.DateTime]::Now.ToString("yyyy")) + \ No newline at end of file diff --git a/TvdbApi.sln b/TvdbApi.sln index 1e25a39..07c455c 100644 --- a/TvdbApi.sln +++ b/TvdbApi.sln @@ -18,6 +18,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution version.json = version.json EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1570EA31-904E-4036-89EE-890A8358C7AA}" + ProjectSection(SolutionItems) = preProject + src\Directory.Build.props = src\Directory.Build.props + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{7849F1D9-4557-41C5-A747-241B92631187}" + ProjectSection(SolutionItems) = preProject + tests\Directory.Build.props = tests\Directory.Build.props + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -36,6 +46,10 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {02CB1507-5FF6-9962-1A70-EC35D9E298ED} = {1570EA31-904E-4036-89EE-890A8358C7AA} + {E72AACA8-0A10-E62A-E526-41B75B6E6348} = {7849F1D9-4557-41C5-A747-241B92631187} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EBB4E090-0583-48B6-AEC2-1AB4E3B98D2A} EndGlobalSection diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..721f1dc --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,17 @@ + + + + Chrison Simtian + $(CurrentYear) - $(Authors) + https://github.com/ChrisonSimtian/TvdbApi + https://github.com/ChrisonSimtian/TvdbApi.git + git + LICENSE + True + README.md + + + + + + \ No newline at end of file diff --git a/src/TvdbClient/TvdbClient.csproj b/src/TvdbClient/TvdbClient.csproj index ff96d83..d99364d 100644 --- a/src/TvdbClient/TvdbClient.csproj +++ b/src/TvdbClient/TvdbClient.csproj @@ -1,12 +1,4 @@  - - - net9.0 - enable - enable - Tvdb - - @@ -18,29 +10,13 @@ - True TVDB Api Client - Chrison Simtian - $([System.DateTime]::Now.ToString(yyyy)) - $(Authors) C# Api Client (HttpClient) for TVDB Api - https://github.com/ChrisonSimtian/TvdbApi - https://github.com/ChrisonSimtian/TvdbApi.git - git - LICENSE - True False - README.md - CS1591;CS8618 - - - - - - diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props new file mode 100644 index 0000000..d5634e1 --- /dev/null +++ b/tests/Directory.Build.props @@ -0,0 +1,18 @@ + + + + true + true + Exe + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/TvdbClient.Tests/AuthenticationUnitTests.cs b/tests/TvdbClient.Tests/AuthenticationUnitTests.cs index f455d47..7bb5c64 100644 --- a/tests/TvdbClient.Tests/AuthenticationUnitTests.cs +++ b/tests/TvdbClient.Tests/AuthenticationUnitTests.cs @@ -1,33 +1,27 @@ using System.Text.Json; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using Tvdb.Clients; using Tvdb.Models; -using Xunit.Abstractions; namespace Tvdb; public class AuthenticationUnitTests { - public AuthenticationUnitTests(ITestOutputHelper outputHelper) + public AuthenticationUnitTests() { - OutputHelper = outputHelper; - var builder = new HostApplicationBuilder(); var config = builder.Configuration .AddTvdbClient() .Build(); ServiceProvider = builder.Services - .AddLogging((builder) => builder.AddXUnit(OutputHelper)) .AddTvdbClient(config) .BuildServiceProvider(); } - public ITestOutputHelper OutputHelper { get; } public ServiceProvider ServiceProvider { get; internal set; } - [Fact] + [Test] public async Task ManuallyAuthenticate_Fact() { // Arrange @@ -63,7 +57,7 @@ public async Task ManuallyAuthenticate_Fact() token.AccessToken.ShouldNotBeNullOrEmpty(); } - [Fact] + [Test] public async Task TestRandomApi_Fact() { // Arrange diff --git a/tests/TvdbClient.Tests/Clients/SeriesClient.cs b/tests/TvdbClient.Tests/Clients/SeriesClient.cs index 400294b..e16e48a 100644 --- a/tests/TvdbClient.Tests/Clients/SeriesClient.cs +++ b/tests/TvdbClient.Tests/Clients/SeriesClient.cs @@ -5,16 +5,13 @@ using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Xunit.Abstractions; namespace Tvdb.Clients; public class SeriesClient { - public SeriesClient(ITestOutputHelper outputHelper) + public SeriesClient() { - OutputHelper = outputHelper; var builder = new HostApplicationBuilder(); var config = builder.Configuration @@ -22,22 +19,20 @@ public SeriesClient(ITestOutputHelper outputHelper) .Build(); ServiceProvider = builder.Services - .AddLogging((builder) => builder.AddXUnit(OutputHelper)) .AddTvdbClient(config) .BuildServiceProvider(); Client = ServiceProvider.GetRequiredService(); } - public ITestOutputHelper OutputHelper { get; } public ServiceProvider ServiceProvider { get; } public ISeriesClient Client { get; } - [Fact] + [Test] public void DependencyInjection_Fact() => Client.ShouldNotBeNull(); - [Theory] - [InlineData(234791)] // Heute Show + [Test] + [Arguments(234791)] // Heute Show public async Task GetSeriesById_Theory(int tvdbId) { // Arrange @@ -53,8 +48,8 @@ public async Task GetSeriesById_Theory(int tvdbId) data.ShouldNotBeNull(); } - [Theory] - [InlineData(234791)] // Heute Show + [Test] + [Arguments(234791)] // Heute Show public async Task GetSeriesExtendedById_Theory(int tvdbId) { // Arrange diff --git a/tests/TvdbClient.Tests/Converters/DateOnlyConverterTests.cs b/tests/TvdbClient.Tests/Converters/DateOnlyConverterTests.cs index 4530d11..982cb22 100644 --- a/tests/TvdbClient.Tests/Converters/DateOnlyConverterTests.cs +++ b/tests/TvdbClient.Tests/Converters/DateOnlyConverterTests.cs @@ -4,68 +4,70 @@ namespace Tvdb.Converters; - public class DateOnlyConverterTests +public class DateOnlyConverterTests +{ + [Test] + public void Read_ValidDate_ReturnsDateOnly() { - [Fact] - public void Read_ValidDate_ReturnsDateOnly() - { - // Arrange - var json = "\"2023-10-05\""; - var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); - var converter = new DateOnlyConverter(null); + // Arrange + var json = "\"2023-10-05\""; + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + var converter = new DateOnlyConverter(null); - // Act - reader.Read(); - var result = converter.Read(ref reader, typeof(DateOnly?), new JsonSerializerOptions()); + // Act + reader.Read(); + var result = converter.Read(ref reader, typeof(DateOnly?), new JsonSerializerOptions()); - // Assert - Assert.NotNull(result); - Assert.Equal(new DateOnly(2023, 10, 5), result); - } + // Assert + result.ShouldNotBeNull(); + result.ShouldBeOfType(); + // Validate the date + result.ShouldBe(new DateOnly(2023, 10, 5)); + } - [Fact] - public void Read_NullOrEmpty_ReturnsNull() - { - // Arrange - var json = "\"\""; - var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); - var converter = new DateOnlyConverter(null); + [Test] + public void Read_NullOrEmpty_ReturnsNull() + { + // Arrange + var json = "\"\""; + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + var converter = new DateOnlyConverter(null); - // Act - reader.Read(); - var result = converter.Read(ref reader, typeof(DateOnly?), new JsonSerializerOptions()); + // Act + reader.Read(); + var result = converter.Read(ref reader, typeof(DateOnly?), new JsonSerializerOptions()); - // Assert - Assert.Null(result); - } + // Assert + result.ShouldBeNull(); + } - [Fact] - public void Write_ValidDate_WritesCorrectJson() - { - // Arrange - var value = new DateOnly(2023, 10, 5); - var options = new JsonSerializerOptions { Converters = { new DateOnlyConverter(null) } }; - var expectedJson = "\"2023-10-05\""; + [Test] + public void Write_ValidDate_WritesCorrectJson() + { + // Arrange + var value = new DateOnly(2023, 10, 5); + var options = new JsonSerializerOptions { Converters = { new DateOnlyConverter(null) } }; + var expectedJson = "\"2023-10-05\""; - // Act - var json = JsonSerializer.Serialize(value, options); + // Act + var json = JsonSerializer.Serialize(value, options); - // Assert - Assert.Equal(expectedJson, json); - } + // Assert + json.ShouldBeEquivalentTo(expectedJson); + } - [Fact] - public void Write_Null_WritesEmptyString() - { - // Arrange - DateOnly? value = null; - var options = new JsonSerializerOptions { Converters = { new DateOnlyConverter(null) } }; - var expectedJson = "null"; + [Test] + public void Write_Null_WritesEmptyString() + { + // Arrange + DateOnly? value = null; + var options = new JsonSerializerOptions { Converters = { new DateOnlyConverter(null) } }; + var expectedJson = "null"; - // Act - var json = JsonSerializer.Serialize(value, options); + // Act + var json = JsonSerializer.Serialize(value, options); - // Assert - Assert.Equal(expectedJson, json); - } - } \ No newline at end of file + // Assert + json.ShouldBeEquivalentTo(expectedJson); + } +} \ No newline at end of file diff --git a/tests/TvdbClient.Tests/Converters/DateTimeConverterTests.cs b/tests/TvdbClient.Tests/Converters/DateTimeConverterTests.cs index 8595cb3..efeac56 100644 --- a/tests/TvdbClient.Tests/Converters/DateTimeConverterTests.cs +++ b/tests/TvdbClient.Tests/Converters/DateTimeConverterTests.cs @@ -3,65 +3,68 @@ using System.Text.Json; namespace Tvdb.Converters; - public class DateTimeConverterTests + +public class DateTimeConverterTests +{ + [Test] + [Arguments(2023, 10, 10, 12, 34, 56)] + public void Read_ValidDate_ReturnsDateTime(int year, int month, int day, int hour, int minute, int second) { - [Fact] - public void Read_ValidDate_ReturnsDateTime() - { - // Arrange - var json = "\"2023-10-10 12:34:56\""; - var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); - var converter = new DateTimeConverter(); + // Arrange + var json = $"\"{year:0000}-{month:00}-{day:00} {hour:00}:{minute:00}:{second:00}\""; + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + var converter = new DateTimeConverter(); - // Act - reader.Read(); - var result = converter.Read(ref reader, typeof(DateTime?), new JsonSerializerOptions()); + // Act + reader.Read(); + var result = converter.Read(ref reader, typeof(DateTime?), new JsonSerializerOptions()); - // Assert - Assert.Equal(new DateTime(2023, 10, 10, 12, 34, 56), result); - } + // Assert + DateTime expectedDate = new(year, month, day, hour, minute, second); + result.ShouldBe(expectedDate); + } - [Fact] - public void Read_NullOrEmptyString_ReturnsNull() - { - // Arrange - var json = "\"\""; - var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); - var converter = new DateTimeConverter(); + [Test] + public void Read_NullOrEmptyString_ReturnsNull() + { + // Arrange + var json = "\"\""; + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + var converter = new DateTimeConverter(); - // Act - reader.Read(); - var result = converter.Read(ref reader, typeof(DateTime?), new JsonSerializerOptions()); + // Act + reader.Read(); + var result = converter.Read(ref reader, typeof(DateTime?), new JsonSerializerOptions()); - // Assert - Assert.Null(result); - } + // Assert + result.ShouldBeNull(); + } - [Fact] - public void Write_ValidDate_WritesCorrectJson() - { - // Arrange - var options = new JsonSerializerOptions { Converters = { new DateTimeConverter() } }; - var dateTime = new DateTime(2023, 10, 10, 12, 34, 56); + [Test] + public void Write_ValidDate_WritesCorrectJson() + { + // Arrange + var options = new JsonSerializerOptions { Converters = { new DateTimeConverter() } }; + var dateTime = new DateTime(2023, 10, 10, 12, 34, 56); - // Act - var json = JsonSerializer.Serialize(dateTime, options); + // Act + var json = JsonSerializer.Serialize(dateTime, options); - // Assert - Assert.Equal("\"2023-10-10T12:34:56\"", json); - } + // Assert + json.ShouldBe("\"2023-10-10T12:34:56\""); + } - [Fact] - public void Write_NullValue_WritesEmptyString() - { - // Arrange - var options = new JsonSerializerOptions { Converters = { new DateTimeConverter() } }; - DateTime? dateTime = null; + [Test] + public void Write_NullValue_WritesEmptyString() + { + // Arrange + var options = new JsonSerializerOptions { Converters = { new DateTimeConverter() } }; + DateTime? dateTime = null; - // Act - var json = JsonSerializer.Serialize(dateTime, options); + // Act + var json = JsonSerializer.Serialize(dateTime, options); - // Assert - Assert.Equal("null", json); - } - } \ No newline at end of file + // Assert + json.ShouldBe("null"); + } +} \ No newline at end of file diff --git a/tests/TvdbClient.Tests/Converters/TimeOnlyConverterTests.cs b/tests/TvdbClient.Tests/Converters/TimeOnlyConverterTests.cs index 78873d6..20c0c6e 100644 --- a/tests/TvdbClient.Tests/Converters/TimeOnlyConverterTests.cs +++ b/tests/TvdbClient.Tests/Converters/TimeOnlyConverterTests.cs @@ -1,71 +1,73 @@ using System; using System.Text; using System.Text.Json; -using Xunit; namespace Tvdb.Converters; - public class TimeOnlyConverterTests + +public class TimeOnlyConverterTests +{ + [Test] + [Arguments(14, 30, 0)] + public void Read_ValidTime_ReturnsTimeOnly(int hour, int minute, int second) { - [Fact] - public void Read_ValidTime_ReturnsTimeOnly() - { - // Arrange - var json = "\"14:30:00\""; - var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); - var converter = new TimeOnlyConverter(null); + // Arrange + var json = $"\"{hour:00}:{minute:00}:{second:00}\""; + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + var converter = new TimeOnlyConverter(null); - // Act - reader.Read(); - var result = converter.Read(ref reader, typeof(TimeOnly?), new JsonSerializerOptions()); + // Act + reader.Read(); + var result = converter.Read(ref reader, typeof(TimeOnly?), new JsonSerializerOptions()); - // Assert - Assert.NotNull(result); - Assert.Equal(new TimeOnly(14, 30, 0), result); - } + // Assert + result.ShouldNotBeNull(); + result.ShouldBeOfType(); + result.ShouldBe(new TimeOnly(hour, minute, second)); + } - [Fact] - public void Read_NullOrEmpty_ReturnsNull() - { - // Arrange - var json = "\"\""; - var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); - var converter = new TimeOnlyConverter(null); + [Test] + public void Read_NullOrEmpty_ReturnsNull() + { + // Arrange + var json = "\"\""; + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + var converter = new TimeOnlyConverter(null); - // Act - reader.Read(); - var result = converter.Read(ref reader, typeof(TimeOnly?), new JsonSerializerOptions()); + // Act + reader.Read(); + var result = converter.Read(ref reader, typeof(TimeOnly?), new JsonSerializerOptions()); - // Assert - Assert.Null(result); - } + // Assert + result.ShouldBeNull(); + } - [Fact] - public void Write_ValidTime_WritesCorrectJson() - { - // Arrange - var value = new TimeOnly(14, 30, 0); - var options = new JsonSerializerOptions { Converters = { new TimeOnlyConverter(null) } }; - var expectedJson = "\"14:30:00\""; + [Test] + public void Write_ValidTime_WritesCorrectJson() + { + // Arrange + var value = new TimeOnly(14, 30, 0); + var options = new JsonSerializerOptions { Converters = { new TimeOnlyConverter(null) } }; + var expectedJson = "\"14:30:00\""; - // Act - var json = JsonSerializer.Serialize(value, options); + // Act + var json = JsonSerializer.Serialize(value, options); - // Assert - Assert.Equal(expectedJson, json); - } + // Assert + json.ShouldBeEquivalentTo(expectedJson); + } - [Fact] - public void Write_Null_WritesEmptyString() - { - // Arrange - TimeOnly? value = null; - var options = new JsonSerializerOptions { Converters = { new TimeOnlyConverter(null) } }; - var expectedJson = "null"; + [Test] + public void Write_Null_WritesEmptyString() + { + // Arrange + TimeOnly? value = null; + var options = new JsonSerializerOptions { Converters = { new TimeOnlyConverter(null) } }; + var expectedJson = "null"; - // Act - var json = JsonSerializer.Serialize(value, options); + // Act + var json = JsonSerializer.Serialize(value, options); - // Assert - Assert.Equal(expectedJson, json); - } - } \ No newline at end of file + // Assert + json.ShouldBeEquivalentTo(expectedJson); + } +} \ No newline at end of file diff --git a/tests/TvdbClient.Tests/Provider/TvdbTokenProviderUnitTests.cs b/tests/TvdbClient.Tests/Provider/TvdbTokenProviderUnitTests.cs index 5e57f57..499cff9 100644 --- a/tests/TvdbClient.Tests/Provider/TvdbTokenProviderUnitTests.cs +++ b/tests/TvdbClient.Tests/Provider/TvdbTokenProviderUnitTests.cs @@ -6,18 +6,15 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using Tvdb.Configuration; -using Xunit.Abstractions; namespace Tvdb.Provider; public class TvdbTokenProviderUnitTests { - public TvdbTokenProviderUnitTests(ITestOutputHelper outputHelper) + public TvdbTokenProviderUnitTests() { - OutputHelper = outputHelper; var builder = new HostApplicationBuilder(); var config = builder.Configuration @@ -25,16 +22,14 @@ public TvdbTokenProviderUnitTests(ITestOutputHelper outputHelper) .Build(); ServiceProvider = builder.Services - .AddLogging((builder) => builder.AddXUnit(OutputHelper)) .Configure(config.GetRequiredSection("TvdbConfiguration")) .AddScoped() .BuildServiceProvider(); } - public ITestOutputHelper OutputHelper { get; } public ServiceProvider ServiceProvider { get; internal set; } - [Fact] + [Test] public async Task AcquireTokenAsync_Fact() { // Arrange diff --git a/tests/TvdbClient.Tests/TvdbClient.Tests.csproj b/tests/TvdbClient.Tests/TvdbClient.Tests.csproj index 1a95a96..63e415c 100644 --- a/tests/TvdbClient.Tests/TvdbClient.Tests.csproj +++ b/tests/TvdbClient.Tests/TvdbClient.Tests.csproj @@ -5,7 +5,7 @@ enable enable false - Tvdb + @@ -19,28 +19,11 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - From 84c2fd120e68737835b462d33c58e626be3bad34 Mon Sep 17 00:00:00 2001 From: Chrison Simtian Date: Sun, 20 Jul 2025 12:47:26 +1200 Subject: [PATCH 5/6] adjust CI to tunit instead of xunit --- .github/workflows/TvdbClient-Unit-Tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TvdbClient-Unit-Tests.yml b/.github/workflows/TvdbClient-Unit-Tests.yml index 31fbeff..590d159 100644 --- a/.github/workflows/TvdbClient-Unit-Tests.yml +++ b/.github/workflows/TvdbClient-Unit-Tests.yml @@ -35,7 +35,7 @@ jobs: run: dotnet build --no-restore - name: Run tests with coverage - run: dotnet test tests/${{env.PROJECT_NAME}}/${{env.PROJECT_NAME}}.csproj --no-build --collect:"XPlat Code Coverage" #-p:CollectCoverage=true -p:CoverletOutputFormat=opencover + run: dotnet test --configuration Release -- --report-trx --results-directory '**/${{env.PROJECT_NAME}}/TestResults' --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage" --settings "coverlet.runsettings" --no-build continue-on-error: true - name: Upload coverage report From aa60094ae1631923b8748f169b82455f886dd949 Mon Sep 17 00:00:00 2001 From: Chrison Simtian Date: Sun, 20 Jul 2025 13:44:21 +1200 Subject: [PATCH 6/6] new workflows --- .github/workflows/code-coverage.yml | 80 ++++++++++++++++ .github/workflows/release.yml | 142 ++++++++++++++++++++++++++++ src/TvdbClient/version.json | 2 +- 3 files changed, 223 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/code-coverage.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml new file mode 100644 index 0000000..d138685 --- /dev/null +++ b/.github/workflows/code-coverage.yml @@ -0,0 +1,80 @@ +name: Code Coverage + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' # Adjust to your .NET version + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore --configuration Release + + - name: Run TUNIT tests with coverage + run: | + dotnet test ./tests --no-build --configuration Release \ + --collect:"XPlat Code Coverage" \ + --results-directory ./test-results \ + --logger "trx;LogFileName=TestResults.trx" \ + --logger "console;verbosity=detailed" + + - name: Install ReportGenerator + run: dotnet tool install -g dotnet-reportgenerator-globaltool + + - name: Generate coverage report + run: | + reportgenerator \ + -reports:"./test-results/**/coverage.cobertura.xml" \ + -targetdir:"./coverage-report" \ + -reporttypes:"Html;Cobertura;MarkdownSummaryGithub" + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results + path: | + ./test-results/**/*.trx + ./coverage-report/**/* + + - name: Publish test results + uses: dorny/test-reporter@v1 + if: always() + with: + name: Test Results + path: './test-results/**/*.trx' + reporter: dotnet-trx + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: ./coverage-report/Cobertura.xml + badge: true + fail_below_min: false # Set to true if you want to fail on low coverage + format: markdown + hide_branch_rate: false + hide_complexity: false + indicators: true + output: both + thresholds: '60 80' # Warning at 60%, error below 80% + + - name: Add Coverage PR Comment + uses: marocchino/sticky-pull-request-comment@v2 + if: github.event_name == 'pull_request' + with: + recreate: true + path: code-coverage-results.md \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..79eb035 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,142 @@ +name: Release + +on: + push: + branches: [ release, release/* ] # Trigger on release branch(es) + workflow_dispatch: # Allows manual trigger from any branch + +jobs: + build-and-test: + runs-on: ubuntu-latest + + outputs: + version: ${{ steps.nbgv.outputs.SemVer2 }} + simple-version: ${{ steps.nbgv.outputs.SimpleVersion }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Full history needed for Nerdbank.GitVersioning + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' # Adjust to your .NET version + + - name: Install Nerdbank.GitVersioning + run: dotnet tool install -g nbgv + + - name: Get Version from Nerdbank.GitVersioning + id: nbgv + run: | + nbgv cloud + echo "SemVer2=$(nbgv get-version -v SemVer2)" >> $GITHUB_OUTPUT + echo "SimpleVersion=$(nbgv get-version -v SimpleVersion)" >> $GITHUB_OUTPUT + echo "Version will be: $(nbgv get-version -v SemVer2)" + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore --configuration Release + + - name: Run TUNIT tests + run: dotnet test ./tests --no-build --configuration Release + + - name: Pack NuGet packages + run: | + dotnet pack ./src --no-build --configuration Release \ + --output ./packages + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: nuget-packages + path: ./packages/*.nupkg + + publish-nuget: + needs: build-and-test + runs-on: ubuntu-latest + + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: nuget-packages + path: ./packages + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' + + - name: Publish to NuGet + run: | + dotnet nuget push "./packages/*.nupkg" \ + --api-key ${{ secrets.NUGET_API_KEY }} \ + --source https://api.nuget.org/v3/index.json \ + --skip-duplicate + + github-release: + needs: [build-and-test, publish-nuget] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: nuget-packages + path: ./packages + + - name: Create source archive + run: | + # Create a clean source archive excluding build artifacts + git archive --format=zip --output=./packages/source-v${{ needs.build-and-test.outputs.simple-version }}.zip HEAD + git archive --format=tar.gz --output=./packages/source-v${{ needs.build-and-test.outputs.simple-version }}.tar.gz HEAD + + - name: Generate Release Notes + id: release_notes + run: | + # Generate basic release notes from commits since last release tag + PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match="v*" 2>/dev/null || echo "") + + echo "## What's Changed" > release_notes.md + if [ -n "$PREVIOUS_TAG" ]; then + echo "" >> release_notes.md + git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD >> release_notes.md + else + echo "- Initial release" >> release_notes.md + fi + + echo "" >> release_notes.md + echo "## NuGet Package" >> release_notes.md + echo "This release is available on NuGet:" >> release_notes.md + echo '```' >> release_notes.md + echo "dotnet add package YourPackageName --version ${{ needs.build-and-test.outputs.version }}" >> release_notes.md + echo '```' >> release_notes.md + + - name: Create Git Tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "v${{ needs.build-and-test.outputs.simple-version }}" -m "Release v${{ needs.build-and-test.outputs.simple-version }}" + git push origin "v${{ needs.build-and-test.outputs.simple-version }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ needs.build-and-test.outputs.simple-version }} + name: Release v${{ needs.build-and-test.outputs.simple-version }} + body_path: release_notes.md + files: | + ./packages/*.nupkg + ./packages/*.zip + ./packages/*.tar.gz + draft: false + prerelease: ${{ contains(needs.build-and-test.outputs.version, '-') }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/src/TvdbClient/version.json b/src/TvdbClient/version.json index 77b4226..7d9a7c7 100644 --- a/src/TvdbClient/version.json +++ b/src/TvdbClient/version.json @@ -4,7 +4,7 @@ "pathFilters": ["."], "publicReleaseRefSpec": [ "^refs/heads/main$", - "^refs/heads/v\\d+(?:\\.\\d+)?$" + "^refs/heads/release(/.*)?$" ], "cloudBuild": { "buildNumber": {