Skip to content

Commit

Permalink
ensure datetime offset is encoded correctly for search APIs (octokit#…
Browse files Browse the repository at this point in the history
…2091)

* add failing integration test for timestamp

* make the test pass by encoding the value

* generalize this pattern for now

* update tests to reflect change in date formatting
  • Loading branch information
shiftkey authored Feb 10, 2020
1 parent 736c3bd commit 5de3791
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 49 deletions.
15 changes: 14 additions & 1 deletion Octokit.Tests.Integration/Clients/SearchClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Octokit;
Expand All @@ -23,6 +24,18 @@ public async Task SearchForCSharpRepositories()
Assert.NotEmpty(repos.Items);
}

[IntegrationTest]
public async Task SearchForCSharpRepositoriesUpdatedIn2020()
{
var request = new SearchRepositoriesRequest("csharp")
{
Updated = DateRange.GreaterThan(new DateTimeOffset(2020, 1, 1, 0, 0, 0, TimeSpan.Zero))
};
var repos = await _gitHubClient.Search.SearchRepo(request);

Assert.NotEmpty(repos.Items);
}

[IntegrationTest]
public async Task SearchForForkedRepositories()
{
Expand Down
Loading

0 comments on commit 5de3791

Please sign in to comment.