From 9d6345d0eabcef5ea28f358b0a04703480d7b815 Mon Sep 17 00:00:00 2001 From: Robert Mills Date: Thu, 28 Nov 2013 17:50:14 -0500 Subject: [PATCH] Initialize Files Initialize Files to reduce needless setup to create a gist. --- Octokit.Tests/Clients/GistsClientTests.cs | 5 +---- Octokit/Models/Request/NewGist.cs | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Octokit.Tests/Clients/GistsClientTests.cs b/Octokit.Tests/Clients/GistsClientTests.cs index 4e89758b..2554b95e 100644 --- a/Octokit.Tests/Clients/GistsClientTests.cs +++ b/Octokit.Tests/Clients/GistsClientTests.cs @@ -33,10 +33,7 @@ public class GistsClientTests newGist.Description = "my new gist"; newGist.Public = true; - var gistFiles = new Dictionary(); - gistFiles.Add("myGistTestFile.cs", "new GistsClient(connection).Create();"); - - newGist.Files = gistFiles; + newGist.Files.Add("myGistTestFile.cs", "new GistsClient(connection).Create();"); client.Create(newGist); diff --git a/Octokit/Models/Request/NewGist.cs b/Octokit/Models/Request/NewGist.cs index bef676ed..9bdd6d35 100644 --- a/Octokit/Models/Request/NewGist.cs +++ b/Octokit/Models/Request/NewGist.cs @@ -1,9 +1,15 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; + namespace Octokit { public class NewGist { + public NewGist() + { + Files = new Dictionary(); + } + /// /// The description of the gist. ///