mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 11:05:56 +00:00
Fix serialization error with null PushedAt
It's possible for a repository to have a null value for the "pushed_at" field. For example, if it's been created online and never pushed to via git.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Integration
|
||||
@@ -22,6 +23,23 @@ namespace Octokit.Tests.Integration
|
||||
Assert.False(repository.Fork);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ReturnsNeverPushedRepository()
|
||||
{
|
||||
var github = new GitHubClient
|
||||
{
|
||||
Credentials = AutomationSettings.Current.GitHubCredentials
|
||||
};
|
||||
|
||||
var repository = await github.Repository.Get("Test-Octowin", "PrivateTestRepository");
|
||||
|
||||
Assert.Equal("https://github.com/Test-Octowin/PrivateTestRepository.git", repository.CloneUrl);
|
||||
Assert.True(repository.Private);
|
||||
Assert.False(repository.Fork);
|
||||
Assert.Equal(3709146, repository.Id);
|
||||
Assert.Null(repository.PushedAt);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ReturnsForkedRepository()
|
||||
{
|
||||
|
||||
@@ -432,7 +432,7 @@ namespace Octokit
|
||||
public int WatchersCount { get; set; }
|
||||
public string MasterBranch { get; set; }
|
||||
public int OpenIssuesCount { get; set; }
|
||||
public DateTimeOffset PushedAt { get; set; }
|
||||
public DateTimeOffset? PushedAt { get; set; }
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
public DateTimeOffset UpdatedAt { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user