mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 04:40:54 +00:00
remove this repository cleanup code
This commit is contained in:
@@ -9,7 +9,7 @@ using Octokit.Tests.Helpers;
|
||||
|
||||
public class RepositoriesClientTests
|
||||
{
|
||||
public class TheCreateMethodForUser : IDisposable
|
||||
public class TheCreateMethodForUser
|
||||
{
|
||||
[IntegrationTest]
|
||||
public async Task CreatesANewPublicRepository()
|
||||
@@ -330,37 +330,6 @@ public class RepositoriesClientTests
|
||||
Task.WhenAll(deleteRepos).Wait();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
|
||||
{
|
||||
Credentials = Helper.Credentials
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
// clean all the repositories for the current user
|
||||
var repositories = github.Repository.GetAllForCurrent().Result;
|
||||
|
||||
foreach (var repository in repositories.Where(x => x.Owner.Login == Helper.Credentials.Login))
|
||||
{
|
||||
try
|
||||
{
|
||||
// only cleanup repositories the current user owns
|
||||
github.Repository.Delete(repository.Owner.Login, repository.Name).Wait();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("An unexpected exception occurred while retrieving repositories for the current user: " + ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TheCreateMethodForOrganization
|
||||
|
||||
Reference in New Issue
Block a user