Skip to content

Commit

Permalink
reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey committed Sep 24, 2019
1 parent a687ded commit 3e7fb01
Show file tree
Hide file tree
Showing 23 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public IObservable<Reaction> GetAll(long repositoryId, int number)
public IObservable<Reaction> GetAll(long repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));

return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.IssueCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public IObservable<Reaction> GetAll(long repositoryId, int number)
public IObservable<Reaction> GetAll(long repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));

return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.IssueReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
}

Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/ObservableMigrationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public IObservable<Migration> GetAll(string org)
public IObservable<Migration> GetAll(string org, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));

return _connection.GetAndFlattenAllPages<Migration>(ApiUrls.EnterpriseMigrations(org), null, AcceptHeaders.MigrationsApiPreview, options);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public IObservable<Reaction> GetAll(long repositoryId, int number)
public IObservable<Reaction> GetAll(long repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));

return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.PullRequestReviewCommentReaction(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public async Task ReturnsCorrectCountOfReactionsWithoutStart()
var reactions = await _github.Reaction.CommitComment.GetAll(_context.RepositoryOwner, _context.RepositoryName, result.Id, options);

Assert.Equal(1, reactions.Count);

Assert.Equal(reaction.Id, reactions[0].Id);
Assert.Equal(reaction.Content, reactions[0].Content);
}
Expand All @@ -111,7 +111,7 @@ public async Task ReturnsCorrectCountOfReactionsWithStart()
Assert.NotNull(result);

var reactions = new List<Reaction>();
var reactionsContent = new []{ ReactionType.Confused, ReactionType.Hooray };
var reactionsContent = new[] { ReactionType.Confused, ReactionType.Hooray };
for (var i = 0; i < 2; i++)
{
var newReaction = new NewReaction(reactionsContent[i]);
Expand All @@ -128,7 +128,7 @@ public async Task ReturnsCorrectCountOfReactionsWithStart()
var reactionsInfo = await _github.Reaction.CommitComment.GetAll(_context.RepositoryOwner, _context.RepositoryName, result.Id, options);

Assert.Equal(1, reactionsInfo.Count);

Assert.Equal(reactions.Last().Id, reactionsInfo[0].Id);
Assert.Equal(reactions.Last().Content, reactionsInfo[0].Content);
}
Expand All @@ -145,7 +145,7 @@ public async Task ReturnsDistinctReactionsBasedOnStartPage()

Assert.NotNull(result);

var reactionsContent = new []{ ReactionType.Confused, ReactionType.Hooray };
var reactionsContent = new[] { ReactionType.Confused, ReactionType.Hooray };
for (var i = 0; i < 2; i++)
{
var newReaction = new NewReaction(reactionsContent[i]);
Expand All @@ -159,7 +159,7 @@ public async Task ReturnsDistinctReactionsBasedOnStartPage()
StartPage = 1
};
var firstPage = await _github.Reaction.CommitComment.GetAll(_context.RepositoryOwner, _context.RepositoryName, result.Id, startOptions);

var skipStartOptions = new ApiOptions
{
PageSize = 1,
Expand Down Expand Up @@ -221,7 +221,7 @@ public async Task ReturnsCorrectCountOfReactionsWithoutStartWithRepositoryId()
var reactions = await _github.Reaction.CommitComment.GetAll(_context.Repository.Id, result.Id, options);

Assert.Equal(1, reactions.Count);

Assert.Equal(reaction.Id, reactions[0].Id);
Assert.Equal(reaction.Content, reactions[0].Content);
}
Expand All @@ -239,7 +239,7 @@ public async Task ReturnsCorrectCountOfReactionsWithStartWithRepositoryId()
Assert.NotNull(result);

var reactions = new List<Reaction>();
var reactionsContent = new []{ ReactionType.Confused, ReactionType.Hooray };
var reactionsContent = new[] { ReactionType.Confused, ReactionType.Hooray };
for (var i = 0; i < 2; i++)
{
var newReaction = new NewReaction(reactionsContent[i]);
Expand All @@ -256,7 +256,7 @@ public async Task ReturnsCorrectCountOfReactionsWithStartWithRepositoryId()
var reactionsInfo = await _github.Reaction.CommitComment.GetAll(_context.Repository.Id, result.Id, options);

Assert.Equal(1, reactionsInfo.Count);

Assert.Equal(reactions.Last().Id, reactionsInfo[0].Id);
Assert.Equal(reactions.Last().Content, reactionsInfo[0].Content);
}
Expand All @@ -273,7 +273,7 @@ public async Task ReturnsDistinctReactionsBasedOnStartPageWithRepositoryId()

Assert.NotNull(result);

var reactionsContent = new []{ ReactionType.Confused, ReactionType.Hooray };
var reactionsContent = new[] { ReactionType.Confused, ReactionType.Hooray };
for (var i = 0; i < 2; i++)
{
var newReaction = new NewReaction(reactionsContent[i]);
Expand All @@ -287,7 +287,7 @@ public async Task ReturnsDistinctReactionsBasedOnStartPageWithRepositoryId()
StartPage = 1
};
var firstPage = await _github.Reaction.CommitComment.GetAll(_context.Repository.Id, result.Id, startOptions);

var skipStartOptions = new ApiOptions
{
PageSize = 1,
Expand All @@ -300,7 +300,7 @@ public async Task ReturnsDistinctReactionsBasedOnStartPageWithRepositoryId()
Assert.Equal(1, secondPage.Count);
Assert.NotEqual(firstPage[0].Id, secondPage[0].Id);
Assert.NotEqual(firstPage[0].Content, secondPage[0].Content);
}
}
[IntegrationTest]
public async Task CanCreateReaction()
{
Expand Down
16 changes: 8 additions & 8 deletions Octokit.Tests.Integration/Clients/IssueReactionsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public async Task ReturnsCorrectCountOfReactionsWithoutStart()
PageSize = 1,
PageCount = 1
};

var issueReactions = await _github.Reaction.Issue.GetAll(_context.RepositoryOwner, _context.RepositoryName, issue.Number, options);

Assert.Equal(1, issueReactions.Count);
Expand Down Expand Up @@ -89,7 +89,7 @@ public async Task ReturnsCorrectCountOfReactionsWithStart()
PageCount = 1,
StartPage = 2
};

var issueReactions = await _github.Reaction.Issue.GetAll(_context.RepositoryOwner, _context.RepositoryName, issue.Number, options);

Assert.Equal(1, issueReactions.Count);
Expand Down Expand Up @@ -121,15 +121,15 @@ public async Task ReturnsDistinctReactionsBasedOnStartPage()
StartPage = 1
};
var firstPage = await _github.Reaction.Issue.GetAll(_context.RepositoryOwner, _context.RepositoryName, issue.Number, startOptions);

var skipStartOptions = new ApiOptions
{
PageSize = 1,
PageCount = 1,
StartPage = 2
};
var secondPage = await _github.Reaction.Issue.GetAll(_context.RepositoryOwner, _context.RepositoryName, issue.Number, skipStartOptions);

Assert.Equal(1, firstPage.Count);
Assert.Equal(1, secondPage.Count);
Assert.NotEqual(firstPage[0].Id, secondPage[0].Id);
Expand Down Expand Up @@ -169,7 +169,7 @@ public async Task ReturnsCorrectCountOfReactionsWithoutStartWithRepositoryId()
PageSize = 1,
PageCount = 1
};

var issueReactions = await _github.Reaction.Issue.GetAll(_context.Repository.Id, issue.Number, options);

Assert.Equal(1, issueReactions.Count);
Expand Down Expand Up @@ -200,7 +200,7 @@ public async Task ReturnsCorrectCountOfReactionsWithStartWithRepositoryId()
PageCount = 1,
StartPage = 2
};

var issueReactions = await _github.Reaction.Issue.GetAll(_context.Repository.Id, issue.Number, options);

Assert.Equal(1, issueReactions.Count);
Expand Down Expand Up @@ -232,15 +232,15 @@ public async Task ReturnsDistinctReactionsBasedOnStartPageWithRepositoryId()
StartPage = 1
};
var firstPage = await _github.Reaction.Issue.GetAll(_context.Repository.Id, issue.Number, startOptions);

var skipStartOptions = new ApiOptions
{
PageSize = 1,
PageCount = 1,
StartPage = 2
};
var secondPage = await _github.Reaction.Issue.GetAll(_context.Repository.Id, issue.Number, skipStartOptions);

Assert.Equal(1, firstPage.Count);
Assert.Equal(1, secondPage.Count);
Assert.NotEqual(firstPage[0].Id, secondPage[0].Id);
Expand Down
8 changes: 4 additions & 4 deletions Octokit.Tests.Integration/Clients/MigrationsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ public async Task ReturnsCorrectCountOfMigrationsWithoutStart()
PageCount = 1,
PageSize = 1
};

var migrations = await _gitHub.Migration.Migrations.GetAll(_orgName, options);

Assert.Equal(1, migrations.Count);
}

[IntegrationTest]
public async Task ReturnsCorrectCountOfMigrationsWithStart()
{
Expand All @@ -90,7 +90,7 @@ public async Task ReturnsCorrectCountOfMigrationsWithStart()
PageSize = 1,
StartPage = 2
};

var migrations = await _gitHub.Migration.Migrations.GetAll(_orgName, options);

Assert.Equal(1, migrations.Count);
Expand All @@ -105,7 +105,7 @@ public async Task ReturnsDistinctMigrationsBasedOnStartPage()
PageSize = 1,
StartPage = 1
};

var firstPage = await _gitHub.Migration.Migrations.GetAll(_orgName, startOptions);

var skipStartOptions = new ApiOptions
Expand Down
6 changes: 3 additions & 3 deletions Octokit.Tests.Integration/Clients/PullRequestsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public async Task CanCreate()
public async Task CanCreateDraft()
{
await CreateTheWorld();

var newPullRequest = new NewPullRequest("a draft pull request", branchName, "master") { Draft = true };
var result = await _fixture.Create(Helper.UserName, _context.RepositoryName, newPullRequest);
Assert.Equal("a draft pull request", result.Title);
Expand All @@ -63,13 +63,13 @@ public async Task CanCreateWithRepositoryId()
public async Task CanCreateDraftWithRepositoryId()
{
await CreateTheWorld();

var newPullRequest = new NewPullRequest("a draft pull request", branchName, "master") { Draft = true };
var result = await _fixture.Create(_context.Repository.Id, newPullRequest);
Assert.Equal("a draft pull request", result.Title);
Assert.True(result.Draft);
}

[IntegrationTest]
public async Task CanGetForRepository()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions disco
return Enumerable.Empty<IXunitTestCase>();
}

return new[] { new XunitTestCase(diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), TestMethodDisplayOptions.None, testMethod) };
return new[] { new XunitTestCase(diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), TestMethodDisplayOptions.None, testMethod) };
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal MaintenanceModeContext(IConnection connection, bool enabled)
}

private IConnection _connection;

public void Dispose()
{
// Ensure maintenance mode is OFF
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Tests/Clients/IssueCommentReactionsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdApiOptions()
StartPage = 1,
PageSize = 1
};

await client.GetAll(1, 42, options);

connection.Received().GetAll<Reaction>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview", options);
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Tests/Clients/IssueCommentsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public async Task RequestsCorrectUrlWithIssueCommentRequest()
{
Since = new DateTimeOffset(2016, 11, 23, 11, 11, 11, 00, new TimeSpan()),
};

await client.GetAllForIssue("fake", "repo", 3, request);

connection.Received().GetAll<IssueComment>(
Expand Down
4 changes: 2 additions & 2 deletions Octokit.Tests/Clients/IssueReactionsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task RequestsCorrectUrl()

connection.Received().GetAll<Reaction>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/reactions"), null, "application/vnd.github.squirrel-girl-preview", Args.ApiOptions);
}

[Fact]
public async Task RequestsCorrectUrlApiOptions()
{
Expand Down Expand Up @@ -70,7 +70,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdApiOptions()
StartPage = 1,
PageSize = 1
};

await client.GetAll(1, 42, options);

connection.Received().GetAll<Reaction>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/reactions"), null, "application/vnd.github.squirrel-girl-preview", options);
Expand Down
4 changes: 2 additions & 2 deletions Octokit.Tests/Reactive/ObservableIssueCommentsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void RequestsCorrectUrlWithIssueCommentRequest()
client.GetAllForIssue("fake", "repo", 3, request);

gitHubClient.Connection.Received(1).Get<List<IssueComment>>(
new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative),
new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative),
Arg.Is<IDictionary<string, string>>(d => d.Count == 3
&& d["since"] == "2016-11-23T11:11:11Z"),
"application/vnd.github.squirrel-girl-preview");
Expand Down Expand Up @@ -243,7 +243,7 @@ public void RequestsCorrectUrlWithApiOptions()
client.GetAllForIssue("fake", "repo", 3, options);

gitHubClient.Connection.Received(1).Get<List<IssueComment>>(
new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative),
new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative),
Arg.Is<IDictionary<string, string>>(d => d.Count == 4),
"application/vnd.github.squirrel-girl-preview");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void EnsuresNonNullArguments()

Assert.Throws<ArgumentNullException>(() => client.GetAll(null, "name", 1));
Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", null, 1));
Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", "name", 1, null));
Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", "name", 1, null));

Assert.Throws<ArgumentException>(() => client.GetAll("", "name", 1));
Assert.Throws<ArgumentException>(() => client.GetAll("owner", "", 1));
Expand Down
2 changes: 1 addition & 1 deletion Octokit/Clients/IssueCommentReactionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public Task<IReadOnlyList<Reaction>> GetAll(long repositoryId, int number)
public Task<IReadOnlyList<Reaction>> GetAll(long repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));

return ApiConnection.GetAll<Reaction>(ApiUrls.IssueCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Clients/IssueCommentsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public Task<IReadOnlyList<IssueComment>> GetAllForIssue(string owner, string nam
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(request, nameof(request));
Ensure.ArgumentNotNull(options, nameof(options));

return ApiConnection.GetAll<IssueComment>(ApiUrls.IssueComments(owner, name, number), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options);
}

Expand All @@ -279,7 +279,7 @@ public Task<IReadOnlyList<IssueComment>> GetAllForIssue(long repositoryId, int n
{
Ensure.ArgumentNotNull(request, nameof(request));
Ensure.ArgumentNotNull(options, nameof(options));

return ApiConnection.GetAll<IssueComment>(ApiUrls.IssueComments(repositoryId, number), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options);
}

Expand Down
2 changes: 1 addition & 1 deletion Octokit/Clients/PullRequestReviewCommentReactionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Task<IReadOnlyList<Reaction>> GetAll(long repositoryId, int number)
public Task<IReadOnlyList<Reaction>> GetAll(long repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));

return ApiConnection.GetAll<Reaction>(ApiUrls.PullRequestReviewCommentReaction(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
}

Expand Down
2 changes: 1 addition & 1 deletion Octokit/Clients/PullRequestsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Task<PullRequest> Get(string owner, string name, int number)
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

return ApiConnection.Get<PullRequest>(ApiUrls.PullRequest(owner, name, number), null,AcceptHeaders.DraftPullRequestApiPreview);
return ApiConnection.Get<PullRequest>(ApiUrls.PullRequest(owner, name, number), null, AcceptHeaders.DraftPullRequestApiPreview);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Octokit/Models/Request/NewPullRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public NewPullRequest(string title, string head, string baseRef)
/// Body of the pull request (optional)
/// </summary>
public string Body { get; set; }

/// <summary>
/// Whether the pull request is in a draft state or not (optional)
/// </summary>
Expand Down
Loading

0 comments on commit 3e7fb01

Please sign in to comment.