diff --git a/Octokit.Tests.Integration/Clients/StarredClientTests.cs b/Octokit.Tests.Integration/Clients/StarredClientTests.cs index 4187d2c78a..86175afe87 100644 --- a/Octokit.Tests.Integration/Clients/StarredClientTests.cs +++ b/Octokit.Tests.Integration/Clients/StarredClientTests.cs @@ -167,6 +167,8 @@ public async Task CanGetAllForCurrentWithTimestamps() var repo = stars.FirstOrDefault(star => star.Repo.Owner.Login == _repositoryContext.RepositoryOwner && star.Repo.Name == _repositoryContext.RepositoryName); Assert.NotNull(repo); + Assert.NotEqual(DateTimeOffset.MinValue, repo.StarredAt); + Assert.NotNull(repo.Repo); } [IntegrationTest] @@ -232,6 +234,8 @@ public async Task CanGetAllForCurrentWithTimestampsParameterized() var repo = stars.FirstOrDefault(star => star.Repo.Owner.Login == _repositoryContext.RepositoryOwner && star.Repo.Name == _repositoryContext.RepositoryName); Assert.NotNull(repo); + Assert.NotEqual(DateTimeOffset.MinValue, repo.StarredAt); + Assert.NotNull(repo.Repo); for (int i = 1; i < stars.Count; i++) { @@ -456,6 +460,8 @@ public async Task CanGetAllForUserWithTimestamps() var star = stars.FirstOrDefault(repositoryStar => repositoryStar.Repo.Owner.Login == _repositoryContext.RepositoryOwner && repositoryStar.Repo.Name == _repositoryContext.RepositoryName); Assert.NotNull(star); + Assert.NotEqual(DateTimeOffset.MinValue, star.StarredAt); + Assert.NotNull(star.Repo); } [IntegrationTest] @@ -521,6 +527,8 @@ public async Task CanGetAllForUserWithTimestampsParameterized() var repo = stars.FirstOrDefault(repository => repository.Repo.Owner.Login == _repositoryContext.RepositoryOwner && repository.Repo.Name == _repositoryContext.RepositoryName); Assert.NotNull(repo); + Assert.NotEqual(DateTimeOffset.MinValue, repo.StarredAt); + Assert.NotNull(repo.Repo); for (int i = 1; i < stars.Count; i++) { diff --git a/Octokit.Tests/Clients/StarredClientTests.cs b/Octokit.Tests/Clients/StarredClientTests.cs index f49ddc4198..daa13a28d9 100644 --- a/Octokit.Tests/Clients/StarredClientTests.cs +++ b/Octokit.Tests/Clients/StarredClientTests.cs @@ -99,7 +99,7 @@ public async Task RequestsCorrectUrlWithTimestamps() await client.GetAllForCurrentWithTimestamps(); - connection.Received().GetAll(endpoint, null, Args.ApiOptions); + connection.Received().GetAll(endpoint, null, AcceptHeaders.StarJson, Args.ApiOptions); } [Fact] @@ -118,7 +118,7 @@ public async Task RequestsCorrectUrlWithTimestampsWithApiOptions() await client.GetAllForCurrentWithTimestamps(options); - connection.Received().GetAll(endpoint, null, options); + connection.Received().GetAll(endpoint, null, AcceptHeaders.StarJson, options); } [Fact] @@ -132,7 +132,7 @@ public async Task RequestsCorrectUrlWithTimestampsParametrized() await client.GetAllForCurrentWithTimestamps(request); - connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), Args.ApiOptions); + connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), AcceptHeaders.StarJson, Args.ApiOptions); } [Fact] @@ -153,7 +153,7 @@ public async Task RequestsCorrectUrlWithTimestampsParametrizedWithApiOptions() await client.GetAllForCurrentWithTimestamps(request, options); - connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), options); + connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), AcceptHeaders.StarJson, options); } [Fact] @@ -250,7 +250,7 @@ public async Task RequestsCorrectUrlWithTimestamps() await client.GetAllForUserWithTimestamps("banana"); - connection.Received().GetAll(endpoint, null, Args.ApiOptions); + connection.Received().GetAll(endpoint, null, AcceptHeaders.StarJson, Args.ApiOptions); } [Fact] @@ -269,7 +269,7 @@ public async Task RequestsCorrectUrlWithTimestampsWithApiOptions() await client.GetAllForUserWithTimestamps("banana", options); - connection.Received().GetAll(endpoint, null, options); + connection.Received().GetAll(endpoint, null, AcceptHeaders.StarJson, options); } [Fact] @@ -283,7 +283,7 @@ public async Task RequestsCorrectUrlWithTimestampsParametrized() await client.GetAllForUserWithTimestamps("banana", starredRequest); - connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), Args.ApiOptions); + connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), AcceptHeaders.StarJson, Args.ApiOptions); } [Fact] @@ -304,7 +304,7 @@ public async Task RequestsCorrectUrlWithTimestampsParametrizedWithApiOptions() await client.GetAllForUserWithTimestamps("banana", starredRequest, options); - connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), options); + connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), AcceptHeaders.StarJson, options); } [Fact] diff --git a/Octokit/Clients/StarredClient.cs b/Octokit/Clients/StarredClient.cs index 6a4d81e4d3..5aaf40e49e 100644 --- a/Octokit/Clients/StarredClient.cs +++ b/Octokit/Clients/StarredClient.cs @@ -177,7 +177,7 @@ public Task> GetAllForCurrentWithTimestamps(ApiOpt { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Starred(), null, options); + return ApiConnection.GetAll(ApiUrls.Starred(), null, AcceptHeaders.StarJson, options); } /// @@ -237,7 +237,7 @@ public Task> GetAllForCurrentWithTimestamps(Starre Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Starred(), request.ToParametersDictionary(), options); + return ApiConnection.GetAll(ApiUrls.Starred(), request.ToParametersDictionary(), AcceptHeaders.StarJson, options); } /// @@ -293,7 +293,7 @@ public Task> GetAllForUserWithTimestamps(string us Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.StarredByUser(user), null, options); + return ApiConnection.GetAll(ApiUrls.StarredByUser(user), null, AcceptHeaders.StarJson, options); } /// @@ -359,7 +359,7 @@ public Task> GetAllForUserWithTimestamps(string us Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.StarredByUser(user), request.ToParametersDictionary(), options); + return ApiConnection.GetAll(ApiUrls.StarredByUser(user), request.ToParametersDictionary(), AcceptHeaders.StarJson, options); } ///