Skip to content

Commit

Permalink
Fix last RepositoryInvitationsClient test using Octokit user.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdziadkiewicz committed Nov 12, 2017
1 parent 7d8cc5f commit 4fa170c
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class TheGetAllForRepositoryMethod
[IntegrationTest]
public async Task CanGetAllInvitations()
{
var collaborator = "octocat";
var github = Helper.GetAuthenticatedClient();
var repoName = Helper.MakeNameWithTimestamp("public-repo");

Expand All @@ -22,9 +21,9 @@ public async Task CanGetAllInvitations()
var permission = new CollaboratorRequest(Permission.Push);

// invite a collaborator
var response = await fixture.Invite(context.RepositoryOwner, context.RepositoryName, collaborator, permission);
var response = await fixture.Invite(context.RepositoryOwner, context.RepositoryName, context.RepositoryOwner, permission);

Assert.Equal(collaborator, response.Invitee.Login);
Assert.Equal(context.RepositoryOwner, response.Invitee.Login);
Assert.Equal(InvitationPermissionType.Write, response.Permissions);

var invitations = await github.Repository.Invitation.GetAllForRepository(context.Repository.Id);
Expand Down Expand Up @@ -189,7 +188,7 @@ public async Task ReturnsCorrectCountOfInvitationsWithStart()
RepositoryContext[] contexts = null;
try
{
contexts = await Task.WhenAll(repoNames.Select(x => github.CreateRepositoryContext(new NewRepository(x))));
contexts = repoNames.Select(x => github.CreateRepositoryContext(new NewRepository(x)).Result).ToArray();
var fixture = github.Repository.Collaborator;
var permission = new CollaboratorRequest(Permission.Push);

Expand Down Expand Up @@ -229,14 +228,12 @@ public async Task ReturnsCorrectCountOfInvitationsWithStart()
public async Task ReturnsCorrectCountOfInvitationsWithoutStart()
{
var github = Helper.GetAuthenticatedClient();
var repoNames = Enumerable.Range(0, 10)
.Select(i => Helper.MakeNameWithTimestamp($"public-repo{i}"))
.ToList();
var repoNames = Enumerable.Range(0, 6).Select(i => Helper.MakeNameWithTimestamp($"public-repo{i}")).ToList();

RepositoryContext[] contexts = null;
try
{
contexts = await Task.WhenAll(repoNames.Select(x => github.CreateRepositoryContext(new NewRepository(x))));
contexts = repoNames.Select( x => github.CreateRepositoryContext(new NewRepository(x)).Result).ToArray();
var fixture = github.Repository.Collaborator;
var permission = new CollaboratorRequest(Permission.Push);

Expand Down Expand Up @@ -280,7 +277,7 @@ public async Task ReturnsDistinctInvitationsBasedOnStart()
RepositoryContext[] contexts = null;
try
{
contexts = await Task.WhenAll(repoNames.Select(x => github.CreateRepositoryContext(new NewRepository(x))));
contexts = repoNames.Select(x => github.CreateRepositoryContext(new NewRepository(x)).Result).ToArray();
var fixture = github.Repository.Collaborator;
var permission = new CollaboratorRequest(Permission.Push);

Expand Down

0 comments on commit 4fa170c

Please sign in to comment.