From cb4f056a86ccb68b0e0e5157e06f5bc47f2c895f Mon Sep 17 00:00:00 2001 From: Kristian Hellang Date: Tue, 6 Jan 2015 00:51:36 +0100 Subject: [PATCH] Fixed moar failing tests --- Octokit.Tests/Clients/TagsClientTests.cs | 7 +---- Octokit/Models/Response/FeedLink.cs | 16 ++++++------ Octokit/Models/Response/GitHubCommitStats.cs | 11 +++----- Octokit/Models/Response/NotificationInfo.cs | 11 +++++--- Octokit/Models/Response/Plan.cs | 10 +++---- .../Models/Response/RepositoryPermissions.cs | 15 ++++------- Octokit/Models/Response/SignatureResponse.cs | 26 +++++++++++++------ Octokit/Models/Response/TagObject.cs | 2 +- 8 files changed, 49 insertions(+), 49 deletions(-) diff --git a/Octokit.Tests/Clients/TagsClientTests.cs b/Octokit.Tests/Clients/TagsClientTests.cs index 7d693d36..acd13242 100644 --- a/Octokit.Tests/Clients/TagsClientTests.cs +++ b/Octokit.Tests/Clients/TagsClientTests.cs @@ -83,12 +83,7 @@ public class TagsClientTests Tag = "tag-name", Object = "tag-object", Type = TaggedType.Tree, - Tagger = new SignatureResponse - { - Name = "tagger-name", - Email = "tagger-email", - Date = DateTimeOffset.Parse("2013-09-03T13:42:52Z") - } + Tagger = new SignatureResponse("tagger-name", "tagger-email", DateTimeOffset.Parse("2013-09-03T13:42:52Z")) }; var json = new SimpleJsonSerializer().Serialize(tag); diff --git a/Octokit/Models/Response/FeedLink.cs b/Octokit/Models/Response/FeedLink.cs index bb1668fb..87183fd7 100644 --- a/Octokit/Models/Response/FeedLink.cs +++ b/Octokit/Models/Response/FeedLink.cs @@ -11,32 +11,32 @@ namespace Octokit /// /// The GitHub global public timeline /// - public FeedLink Timeline { get; set; } + public FeedLink Timeline { get; protected set; } /// /// The public timeline for any user, using URI template /// - public FeedLink User { get; set; } + public FeedLink User { get; protected set; } /// /// The public timeline for the authenticated user /// - public FeedLink CurrentUserPublic { get; set; } + public FeedLink CurrentUserPublic { get; protected set; } /// /// The private timeline for the authenticated user /// - public FeedLink CurrentUser { get; set; } + public FeedLink CurrentUser { get; protected set; } /// /// The private timeline for activity created by the authenticated user /// - public FeedLink CurrentUserActor { get; set; } + public FeedLink CurrentUserActor { get; protected set; } /// /// The private timeline for the authenticated user for a given organization, using URI template /// - public FeedLink CurrentUserOrganization { get; set; } + public FeedLink CurrentUserOrganization { get; protected set; } } /// @@ -47,12 +47,12 @@ namespace Octokit /// /// Link to feed /// - public string Href { get; set; } + public string Href { get; protected set; } /// /// Feed type, e.g. application/atom+xml /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] - public string Type { get; set; } + public string Type { get; protected set; } } } \ No newline at end of file diff --git a/Octokit/Models/Response/GitHubCommitStats.cs b/Octokit/Models/Response/GitHubCommitStats.cs index 940d3550..91caca3d 100644 --- a/Octokit/Models/Response/GitHubCommitStats.cs +++ b/Octokit/Models/Response/GitHubCommitStats.cs @@ -13,24 +13,21 @@ namespace Octokit /// /// The number of additions made within the commit /// - public int Additions { get; set; } + public int Additions { get; protected set; } /// /// The number of deletions made within the commit /// - public int Deletions { get; set; } + public int Deletions { get; protected set; } /// /// The total number of modifications within the commit /// - public int Total { get; set; } + public int Total { get; protected set; } internal string DebuggerDisplay { - get - { - return String.Format(CultureInfo.InvariantCulture, "Stats: +{0} -{1} ={2}", Additions, Deletions, Total); - } + get { return String.Format(CultureInfo.InvariantCulture, "Stats: +{0} -{1} ={2}", Additions, Deletions, Total); } } } } diff --git a/Octokit/Models/Response/NotificationInfo.cs b/Octokit/Models/Response/NotificationInfo.cs index db1670cc..65ea31a8 100644 --- a/Octokit/Models/Response/NotificationInfo.cs +++ b/Octokit/Models/Response/NotificationInfo.cs @@ -4,11 +4,14 @@ namespace Octokit { public class NotificationInfo { - public string Title { get; set; } - public string Url { get; set; } - public string LatestCommentUrl { get; set; } + public string Title { get; protected set; } + + public string Url { get; protected set; } + + public string LatestCommentUrl { get; protected set; } + [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "Matches the property name used by the API")] - public string Type { get; set; } + public string Type { get; protected set; } } } diff --git a/Octokit/Models/Response/Plan.cs b/Octokit/Models/Response/Plan.cs index a7740656..6d285a30 100644 --- a/Octokit/Models/Response/Plan.cs +++ b/Octokit/Models/Response/Plan.cs @@ -9,28 +9,28 @@ namespace Octokit /// The number of collaborators allowed with this plan. /// /// This returns because GitHub Enterprise uses a sentinel value of 999999999999 to denote an "unlimited" number of collaborators. - public long Collaborators { get; set; } + public long Collaborators { get; protected set; } /// /// The name of the plan. /// - public string Name { get; set; } + public string Name { get; protected set; } /// /// The number of private repositories allowed with this plan. /// /// This returns because GitHub Enterprise uses a sentinel value of 999999999999 to denote an "unlimited" number of plans. - public long PrivateRepos { get; set; } + public long PrivateRepos { get; protected set; } /// /// The amount of disk space allowed with this plan. /// /// This returns because GitHub Enterprise uses a sentinel value of 999999999999 to denote an "unlimited" amount of disk space. - public long Space { get; set; } + public long Space { get; protected set; } /// /// The billing email for the organization. Only has a value in response to editing an organization. /// - public string BillingEmail { get; set; } + public string BillingEmail { get; protected set; } } } \ No newline at end of file diff --git a/Octokit/Models/Response/RepositoryPermissions.cs b/Octokit/Models/Response/RepositoryPermissions.cs index 1997dffb..62c3c413 100644 --- a/Octokit/Models/Response/RepositoryPermissions.cs +++ b/Octokit/Models/Response/RepositoryPermissions.cs @@ -1,6 +1,5 @@ using System; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Globalization; namespace Octokit @@ -11,25 +10,21 @@ namespace Octokit /// /// Whether the current user has administrative permissions /// - public bool Admin { get; set; } + public bool Admin { get; protected set; } /// /// Whether the current user has push permissions /// - public bool Push { get; set; } + public bool Push { get; protected set; } /// /// Whether the current user has pull permissions /// - public bool Pull { get; set; } - + public bool Pull { get; protected set; } internal string DebuggerDisplay { - get - { - return String.Format(CultureInfo.InvariantCulture, "Admin: {0}, Push: {1}, Pull: {2}", Admin, Push, Pull); - } + get { return String.Format(CultureInfo.InvariantCulture, "Admin: {0}, Push: {1}, Pull: {2}", Admin, Push, Pull); } } } -} \ No newline at end of file +} diff --git a/Octokit/Models/Response/SignatureResponse.cs b/Octokit/Models/Response/SignatureResponse.cs index 517d5b3b..854cc2e0 100644 --- a/Octokit/Models/Response/SignatureResponse.cs +++ b/Octokit/Models/Response/SignatureResponse.cs @@ -7,16 +7,26 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class SignatureResponse { - public string Name { get; set; } - public string Email { get; set; } - public DateTimeOffset Date { get; set; } + public SignatureResponse() + { + } + + public SignatureResponse(string name, string email, DateTimeOffset date) + { + Name = name; + Email = email; + Date = date; + } + + public string Name { get; protected set; } + + public string Email { get; protected set; } + + public DateTimeOffset Date { get; protected set; } internal string DebuggerDisplay { - get - { - return String.Format(CultureInfo.InvariantCulture, "Name: {0} Email: {1} Date: {2}", Name, Email, Date); - } + get { return String.Format(CultureInfo.InvariantCulture, "Name: {0} Email: {1} Date: {2}", Name, Email, Date); } } } -} \ No newline at end of file +} diff --git a/Octokit/Models/Response/TagObject.cs b/Octokit/Models/Response/TagObject.cs index 183f754f..85652276 100644 --- a/Octokit/Models/Response/TagObject.cs +++ b/Octokit/Models/Response/TagObject.cs @@ -4,7 +4,7 @@ { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "Name defined by web api and required for deserialisation")] - public TaggedType Type { get; set; } + public TaggedType Type { get; protected set; } } ///