Update Repository to include WatchersCount (#2182)

This commit is contained in:
KarolGrzesiak
2020-06-07 19:11:56 +02:00
committed by GitHub
parent 1c026db1a9
commit 62c0b1fe08
2 changed files with 9 additions and 3 deletions
@@ -655,10 +655,11 @@ public class RepositoriesClientTests
var repository = await github.Repository.Get("haacked", "seegit");
Assert.Equal("https://github.com/Haacked/SeeGit.git", repository.CloneUrl);
Assert.Equal("https://github.com/Haacked/SeeGit.git", repository.CloneUrl, ignoreCase: true);
Assert.False(repository.Private);
Assert.False(repository.Fork);
Assert.Equal(AccountType.User, repository.Owner.Type);
Assert.True(repository.WatchersCount > 0);
}
[IntegrationTest]
@@ -668,10 +669,11 @@ public class RepositoriesClientTests
var repository = await github.Repository.Get(3622414);
Assert.Equal("https://github.com/Haacked/SeeGit.git", repository.CloneUrl);
Assert.Equal("https://github.com/Haacked/SeeGit.git", repository.CloneUrl, ignoreCase: true);
Assert.False(repository.Private);
Assert.False(repository.Fork);
Assert.Equal(AccountType.User, repository.Owner.Type);
Assert.True(repository.WatchersCount > 0);
}
[IntegrationTest]
+5 -1
View File
@@ -14,7 +14,7 @@ namespace Octokit
Id = id;
}
public Repository(string url, string htmlUrl, string cloneUrl, string gitUrl, string sshUrl, string svnUrl, string mirrorUrl, long id, string nodeId, User owner, string name, string fullName, bool isTemplate, string description, string homepage, string language, bool @private, bool fork, int forksCount, int stargazersCount, string defaultBranch, int openIssuesCount, DateTimeOffset? pushedAt, DateTimeOffset createdAt, DateTimeOffset updatedAt, RepositoryPermissions permissions, Repository parent, Repository source, LicenseMetadata license, bool hasIssues, bool hasWiki, bool hasDownloads, bool hasPages, int subscribersCount, long size, bool? allowRebaseMerge, bool? allowSquashMerge, bool? allowMergeCommit, bool archived)
public Repository(string url, string htmlUrl, string cloneUrl, string gitUrl, string sshUrl, string svnUrl, string mirrorUrl, long id, string nodeId, User owner, string name, string fullName, bool isTemplate, string description, string homepage, string language, bool @private, bool fork, int forksCount, int stargazersCount, string defaultBranch, int openIssuesCount, DateTimeOffset? pushedAt, DateTimeOffset createdAt, DateTimeOffset updatedAt, RepositoryPermissions permissions, Repository parent, Repository source, LicenseMetadata license, bool hasIssues, bool hasWiki, bool hasDownloads, bool hasPages, int subscribersCount, long size, bool? allowRebaseMerge, bool? allowSquashMerge, bool? allowMergeCommit, bool archived, int watchersCount)
{
Url = url;
HtmlUrl = htmlUrl;
@@ -55,6 +55,7 @@ namespace Octokit
AllowSquashMerge = allowSquashMerge;
AllowMergeCommit = allowMergeCommit;
Archived = archived;
WatchersCount = watchersCount;
}
public string Url { get; protected set; }
@@ -100,6 +101,8 @@ namespace Octokit
public int StargazersCount { get; protected set; }
public int WatchersCount { get; protected set; }
public string DefaultBranch { get; protected set; }
public int OpenIssuesCount { get; protected set; }
@@ -132,6 +135,7 @@ namespace Octokit
public bool HasPages { get; protected set; }
[Obsolete("Update your code to use WatchersCount as this field will stop containing data in the future")]
public int SubscribersCount { get; protected set; }
public long Size { get; protected set; }