diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9dc805b..8a68d92 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} SONAR_TOKEN: ${{secrets.SONAR_TOKEN}} SONAR_PROJECT_KEY: ImgurAPI - SONAR_PROJECT_NAME: Imgur.API + SONAR_PROJECT_NAME: Imgur.API steps: - name: Checkout @@ -59,14 +59,6 @@ jobs: - name: Setup SonarScanner run: dotnet tool install --global dotnet-sonarscanner --version 4.10.0 - - - name: Setup NuGet Cache - uses: actions/cache@v2 - with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} - restore-keys: | - ${{ runner.os }}-nuget- - name: Restore run: dotnet restore --use-lock-file @@ -110,23 +102,18 @@ jobs: DOTNET_NOLOGO: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - steps: - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.301 - source-url: https://nuget.pkg.github.com/DamienDennehy/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - + steps: - name: Download Artifacts uses: actions/download-artifact@v2 with: name: ubuntu-latest path: ./artifacts + - name: Add GitHub Packages Source + run: dotnet nuget add source https://nuget.pkg.github.com/DamienDennehy/index.json --name GitHub --username DamienDennehy --password ${{secrets.GITHUB_TOKEN}} --store-password-in-clear-text + - name: Push to GitHub Packages - run: dotnet nuget push .\artifacts\**\*.nupkg --skip-duplicate --no-symbols true + run: dotnet nuget push .\artifacts\**\*.nupkg --source GitHub --skip-duplicate --no-symbols true env: DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLE: false diff --git a/tests/Imgur.API.Tests/AuthenticationTests/ApiClientTests.cs b/tests/Imgur.API.Tests/AuthenticationTests/ApiClientTests.cs index 90a1a6b..87ff1e1 100644 --- a/tests/Imgur.API.Tests/AuthenticationTests/ApiClientTests.cs +++ b/tests/Imgur.API.Tests/AuthenticationTests/ApiClientTests.cs @@ -61,7 +61,7 @@ public void SetOAuth2Token_WithNullAccessToken_ThrowsArgumentException() AccessToken = null, AccountId = (int)DateTime.Now.Ticks, AccountUsername = Guid.NewGuid().ToString(), - ExpiresIn = DateTime.Now.Minute, + ExpiresIn = (int)DateTime.Now.Ticks, RefreshToken = Guid.NewGuid().ToString(), TokenType = Guid.NewGuid().ToString() }; @@ -84,7 +84,7 @@ public void SetOAuth2Token_WithNullAccountId_ThrowsArgumentException() AccessToken = Guid.NewGuid().ToString(), AccountId = 0, AccountUsername = Guid.NewGuid().ToString(), - ExpiresIn = DateTime.Now.Minute, + ExpiresIn = (int)DateTime.Now.Ticks, RefreshToken = Guid.NewGuid().ToString(), TokenType = Guid.NewGuid().ToString() }; @@ -107,7 +107,7 @@ public void SetOAuth2Token_WithNullAccountUsername_ThrowsArgumentException() AccessToken = Guid.NewGuid().ToString(), AccountId = (int)DateTime.Now.Ticks, AccountUsername = null, - ExpiresIn = DateTime.Now.Minute, + ExpiresIn = (int)DateTime.Now.Ticks, RefreshToken = Guid.NewGuid().ToString(), TokenType = Guid.NewGuid().ToString() }; @@ -153,7 +153,7 @@ public void SetOAuth2Token_WithNullRefreshToken_ThrowsArgumentException() AccessToken = Guid.NewGuid().ToString(), AccountId = (int)DateTime.Now.Ticks, AccountUsername = Guid.NewGuid().ToString(), - ExpiresIn = DateTime.Now.Minute, + ExpiresIn = (int)DateTime.Now.Ticks, RefreshToken = null, TokenType = Guid.NewGuid().ToString() }; @@ -176,7 +176,7 @@ public void SetOAuth2Token_WithNullTokenType_ThrowsArgumentException() AccessToken = Guid.NewGuid().ToString(), AccountId = (int)DateTime.Now.Ticks, AccountUsername = Guid.NewGuid().ToString(), - ExpiresIn = DateTime.Now.Minute, + ExpiresIn = (int)DateTime.Now.Ticks, RefreshToken = Guid.NewGuid().ToString(), TokenType = null }; @@ -199,7 +199,7 @@ public void OAuth2Token_SetByClientIdConstructor_AreSame() AccessToken = Guid.NewGuid().ToString(), AccountId = (int)DateTime.Now.Ticks, AccountUsername = Guid.NewGuid().ToString(), - ExpiresIn = DateTime.Now.Minute, + ExpiresIn = (int)DateTime.Now.Ticks, RefreshToken = Guid.NewGuid().ToString(), TokenType = Guid.NewGuid().ToString() }; @@ -217,7 +217,7 @@ public void OAuth2Token_SetBySetOAuth2Token_AreSame() AccessToken = Guid.NewGuid().ToString(), AccountId = (int)DateTime.Now.Ticks, AccountUsername = Guid.NewGuid().ToString(), - ExpiresIn = DateTime.Now.Minute, + ExpiresIn = (int)DateTime.Now.Ticks, RefreshToken = Guid.NewGuid().ToString(), TokenType = Guid.NewGuid().ToString() }; @@ -237,7 +237,7 @@ public void OAuth2Token_SetBySetOAuth2Token_Null() AccessToken = Guid.NewGuid().ToString(), AccountId = (int)DateTime.Now.Ticks, AccountUsername = Guid.NewGuid().ToString(), - ExpiresIn = DateTime.Now.Minute, + ExpiresIn = (int)DateTime.Now.Ticks, RefreshToken = Guid.NewGuid().ToString(), TokenType = Guid.NewGuid().ToString() };