diff --git a/Octokit.Tests.Integration/Clients/GistsClientTests.cs b/Octokit.Tests.Integration/Clients/GistsClientTests.cs index 53c96392..3df84b68 100644 --- a/Octokit.Tests.Integration/Clients/GistsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/GistsClientTests.cs @@ -62,7 +62,7 @@ public class GistsClientTests Assert.DoesNotThrow(async () => { await _fixture.Delete(createdGist.Id); }); } - [IntegrationTest] + [IntegrationTest(Skip = "See https://github.com/octokit/octokit.net/issues/424 for an explanation of the issue")] public async Task CanStarAndUnstarAGist() { Assert.DoesNotThrow(async () => { await _fixture.Star(testGistId); }); diff --git a/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs b/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs index cceb0cca..e80ca018 100644 --- a/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs +++ b/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs @@ -245,7 +245,7 @@ public class RepositoriesClientTests { Name = repoName, AutoInit = true, - GitignoreTemplate = "visualstudio" + GitignoreTemplate = "VisualStudio" }); try diff --git a/Octokit.Tests/Models/DeploymentStatusTests.cs b/Octokit.Tests/Models/DeploymentStatusTests.cs index 5a8b295d..c904d6b8 100644 --- a/Octokit.Tests/Models/DeploymentStatusTests.cs +++ b/Octokit.Tests/Models/DeploymentStatusTests.cs @@ -1,4 +1,5 @@ -using Octokit.Internal; +using System.Linq; +using Octokit.Internal; using System; using System.Collections.Generic; using Xunit; @@ -15,7 +16,7 @@ namespace Octokit.Tests.Models Id = 1, Url = "https://api.github.com/repos/octocat/example/deployments/1/statuses/42", State = DeploymentState.Success, - Payload = "{\"environment\":\"production\"}", + Payload = new Dictionary { { "environment", "production" } }, TargetUrl = "https://gist.github.com/628b2736d379f", CreatedAt = DateTimeOffset.Parse("2012-07-20T01:19:13Z"), UpdatedAt = DateTimeOffset.Parse("2012-07-20T01:19:13Z"), @@ -46,7 +47,7 @@ namespace Octokit.Tests.Models ""type"": ""User"", ""site_admin"": false }, - ""payload"": ""{\""environment\"":\""production\""}"", + ""payload"": { ""environment"":""production""}, ""target_url"": ""https://gist.github.com/628b2736d379f"", ""created_at"": ""2012-07-20T01:19:13Z"", ""updated_at"": ""2012-07-20T01:19:13Z"", @@ -68,10 +69,19 @@ namespace Octokit.Tests.Models if (x == null || y == null) return false; + if (x.Payload.Keys.Any(key => x.Payload[key] != y.Payload[key])) + { + return false; + } + + if (y.Payload.Keys.Any(key => x.Payload[key] != y.Payload[key])) + { + return false; + } + return x.Id == y.Id && x.Url == y.Url && x.State == y.State && - x.Payload == y.Payload && x.TargetUrl == y.TargetUrl && x.CreatedAt == y.CreatedAt && x.UpdatedAt == y.UpdatedAt && diff --git a/Octokit.Tests/Models/DeploymentTests.cs b/Octokit.Tests/Models/DeploymentTests.cs index c408c759..824b3c4e 100644 --- a/Octokit.Tests/Models/DeploymentTests.cs +++ b/Octokit.Tests/Models/DeploymentTests.cs @@ -1,4 +1,5 @@ -using Octokit.Internal; +using System.Linq; +using Octokit.Internal; using System; using System.Collections.Generic; using Xunit; @@ -14,7 +15,7 @@ namespace Octokit.Tests.Models Id = 1, Sha = "topic-branch", Url = "https://api.github.com/repos/octocat/example/deployments/1", - Payload = "{\"environment\":\"production\"}", + Payload = new Dictionary{{ "environment", "production"}}, CreatedAt = DateTimeOffset.Parse("2012-07-20T01:19:13Z"), UpdatedAt = DateTimeOffset.Parse("2012-07-20T01:19:13Z"), Description = "Deploy request from hubot", @@ -45,7 +46,7 @@ namespace Octokit.Tests.Models ""type"": ""User"", ""site_admin"": false }, - ""payload"": ""{\""environment\"":\""production\""}"", + ""payload"": { ""environment"":""production""}, ""created_at"": ""2012-07-20T01:19:13Z"", ""updated_at"": ""2012-07-20T01:19:13Z"", ""description"": ""Deploy request from hubot"", @@ -71,10 +72,19 @@ namespace Octokit.Tests.Models if (x == null || y == null) return false; + if (x.Payload.Keys.Any(key => x.Payload[key] != y.Payload[key])) + { + return false; + } + + if (y.Payload.Keys.Any(key => x.Payload[key] != y.Payload[key])) + { + return false; + } + return x.Id == y.Id && x.Sha == y .Sha && x.Url == y.Url && - x.Payload == y.Payload && x.CreatedAt == y.CreatedAt && x.UpdatedAt == y.UpdatedAt && x.Description == y.Description && diff --git a/Octokit/Models/Response/Deployment.cs b/Octokit/Models/Response/Deployment.cs index dee40fbe..fd99b3b4 100644 --- a/Octokit/Models/Response/Deployment.cs +++ b/Octokit/Models/Response/Deployment.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; @@ -33,7 +34,8 @@ namespace Octokit /// /// JSON payload with extra information about the deployment. /// - public string Payload { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public IDictionary Payload { get; set; } /// /// Date and time that the deployment was created. diff --git a/Octokit/Models/Response/DeploymentStatus.cs b/Octokit/Models/Response/DeploymentStatus.cs index c5578cf5..f361074c 100644 --- a/Octokit/Models/Response/DeploymentStatus.cs +++ b/Octokit/Models/Response/DeploymentStatus.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -7,6 +9,11 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class DeploymentStatus { + public DeploymentStatus() + { + Payload = new Dictionary(); + } + /// /// Id of this deployment status. /// @@ -30,7 +37,8 @@ namespace Octokit /// /// JSON payload with extra information about the deployment. /// - public string Payload { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public IDictionary Payload { get; set; } /// /// The target URL of this deployment status. This URL should contain diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 44aaa3ef..b5ff3913 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,14 @@ +### New in 0.2.2 (Released 2014/03/06) +* Task-based and Observable-based APIs are now consistent - #361 #376 #378 via @shiftkey and @ammeep +* "_links" JSON field serialization convention fix - #387 via @haacked +* Added Feeds client - #386 via @sgwill +* Added support for creating Gists - #391 via @Therzok and @rgmills +* Make readonly collections truly readonly - #394 #399 via @Haacked +* Internalize ProductHeaderValue - #406 via @trsneed +* HttpClient.Send without cancellation token - #410 via @ammeep +* Implement Repository Comments API - #413 via @Haacked @wfroese +* Corrected Search response to match API - #412 #417 #419 #420 via @shiftkey + ### New in 0.2.1 (Released 2014/02/19) * Reverted the dependency on Reactive Extensions 2.2.2 which introduced breaking changes diff --git a/SolutionInfo.cs b/SolutionInfo.cs index ccd2aa84..da6155a7 100644 --- a/SolutionInfo.cs +++ b/SolutionInfo.cs @@ -3,11 +3,11 @@ using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyProductAttribute("Octokit")] -[assembly: AssemblyVersionAttribute("0.2.1")] -[assembly: AssemblyFileVersionAttribute("0.2.1")] +[assembly: AssemblyVersionAttribute("0.2.2")] +[assembly: AssemblyFileVersionAttribute("0.2.2")] [assembly: ComVisibleAttribute(false)] namespace System { internal static class AssemblyVersionInformation { - internal const string Version = "0.2.1"; + internal const string Version = "0.2.2"; } }