Skip to content

Commit

Permalink
Migrations API: Added deletion integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
devkhan committed Mar 30, 2016
1 parent 16593eb commit 11120d0
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Octokit.Tests.Integration/Clients/MigrationsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,48 @@ public async Task CanGetArchive()
Assert.NotEmpty(url);
}
}

public class TheDeleteArchiveMethod
{
readonly IGitHubClient _gitHub;

public TheDeleteArchiveMethod()
{
_gitHub = Helper.GetAuthenticatedClient();
}

[IntegrationTest]
public async Task DeletesArchive()
{
var organization = Environment.GetEnvironmentVariable("OCTOKIT_GITHUBORGANIZATION");
var repos = (await _gitHub.Repository.GetAllForOrg(organization));
var repoNames = repos.Select(repo => repo.FullName).ToList();
var migrationRequest = new StartMigrationRequest(repoNames);
var migration = await _gitHub.Migration.Migrations.Start(organization, migrationRequest);

await _gitHub.Migration.Migrations.DeleteArchive(organization, migration.Id);
}
}

public class TheUnlockRepositoryMethod
{
readonly IGitHubClient _gitHub;

public TheUnlockRepositoryMethod()
{
_gitHub = Helper.GetAuthenticatedClient();
}

[IntegrationTest]
public async Task UnlocksRepository()
{
var organization = Environment.GetEnvironmentVariable("OCTOKIT_GITHUBORGANIZATION");
var repos = (await _gitHub.Repository.GetAllForOrg(organization));
var repoNames = repos.Select(repo => repo.FullName).ToList();
var migrationRequest = new StartMigrationRequest(repoNames, true);
var migration = await _gitHub.Migration.Migrations.Start(organization, migrationRequest);

await _gitHub.Migration.Migrations.UnlockRepository(organization, migration.Id, migration.Repositories[0].FullName);
}
}
}

0 comments on commit 11120d0

Please sign in to comment.