mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-02 19:00:47 +00:00
Update impacted tests to use new Context creation and Delete helper methods
This commit is contained in:
@@ -433,7 +433,7 @@ public class RepositoriesClientTests
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Helper.DeleteRepo(_repository);
|
||||
Helper.DeleteRepo(Helper.GetAuthenticatedClient().Connection, _repository);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
// The fork is created asynchronously by github and therefore it cannot
|
||||
// be certain that the repo exists when the test ends. It is therefore deleted
|
||||
// before the test starts instead of after.
|
||||
Helper.DeleteRepo(Helper.Credentials.Login, "octokit.net");
|
||||
Helper.DeleteRepo(Helper.GetAuthenticatedClient().Connection, Helper.Credentials.Login, "octokit.net");
|
||||
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
// The fork is created asynchronously by github and therefore it cannot
|
||||
// be certain that the repo exists when the test ends. It is therefore deleted
|
||||
// before the test starts.
|
||||
Helper.DeleteRepo(Helper.Organization, "octokit.net");
|
||||
Helper.DeleteRepo(Helper.GetAuthenticatedClient().Connection, Helper.Organization, "octokit.net");
|
||||
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
{
|
||||
string renamedUsername = Helper.MakeNameWithTimestamp("user-renamed");
|
||||
// Create a disposable user for the test
|
||||
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
|
||||
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
|
||||
{
|
||||
var response = await _github.User.Administration.Rename(
|
||||
context.UserLogin,
|
||||
@@ -79,14 +79,14 @@ namespace Octokit.Tests.Integration.Clients
|
||||
}
|
||||
|
||||
// Remove user if it was already renamed
|
||||
EnterpriseHelper.DeleteUser(renamedUsername);
|
||||
EnterpriseHelper.DeleteUser(_github.Connection, renamedUsername);
|
||||
}
|
||||
|
||||
[GitHubEnterpriseTest]
|
||||
public async Task CanAddAndDeleteImpersonationToken()
|
||||
{
|
||||
// Create a disposable user for the test
|
||||
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
|
||||
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
|
||||
{
|
||||
// Create Impersonation token
|
||||
var token = await _github.User.Administration.CreateImpersonationToken(
|
||||
@@ -109,7 +109,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
User checkUser = null;
|
||||
|
||||
// Create a disposable user for the test
|
||||
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
|
||||
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
|
||||
{
|
||||
// Ensure user is not site admin
|
||||
checkUser = await _github.User.Get(context.UserLogin);
|
||||
@@ -137,7 +137,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
User checkUser = null;
|
||||
|
||||
// Create a disposable user for the test
|
||||
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
|
||||
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
|
||||
{
|
||||
// Ensure user is not suspended
|
||||
checkUser = await _github.User.Get(context.UserLogin);
|
||||
@@ -163,7 +163,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
public async Task CanListAllPublicKeys()
|
||||
{
|
||||
// Create a disposable user for the test
|
||||
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
|
||||
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
|
||||
{
|
||||
// Ensure user has a key
|
||||
//var key = await _github.User.Keys.Create(new NewPublicKey("title", "key"));
|
||||
@@ -183,7 +183,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
public async Task CanDeletePublicKey()
|
||||
{
|
||||
// Create a disposable user for the test
|
||||
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
|
||||
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
|
||||
{
|
||||
// Ensure user has a key
|
||||
//var key = await _github.User.Keys.Create(new NewPublicKey("title", "key"));
|
||||
|
||||
@@ -101,6 +101,6 @@ public class ObservableRespositoryDeployKeysClientTests : IDisposable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Helper.DeleteRepo(_repository);
|
||||
Helper.DeleteRepo(Helper.GetAuthenticatedClient().Connection, _repository);
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
}
|
||||
|
||||
// Remove user if it was already renamed
|
||||
EnterpriseHelper.DeleteUser(renamedUsername);
|
||||
EnterpriseHelper.DeleteUser(_github.Connection, renamedUsername);
|
||||
}
|
||||
|
||||
[GitHubEnterpriseTest]
|
||||
|
||||
Reference in New Issue
Block a user