mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 19:11:30 +00:00
wireup delete API
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Net.Http.Headers;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
@@ -17,5 +17,26 @@ namespace Octokit.Tests.Integration.Clients
|
||||
var emails = await github.User.Email.GetAll();
|
||||
Assert.NotEmpty(emails);
|
||||
}
|
||||
|
||||
const string testEmailAddress = "hahaha-not-a-real-email@foo.com";
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanAddAndDeleteEmail()
|
||||
{
|
||||
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
|
||||
{
|
||||
Credentials = Helper.Credentials
|
||||
};
|
||||
|
||||
await github.User.Email.Add(testEmailAddress);
|
||||
|
||||
var emails = await github.User.Email.GetAll();
|
||||
Assert.Contains(testEmailAddress, emails.Select(x => x.Email));
|
||||
|
||||
await github.User.Email.Delete(testEmailAddress);
|
||||
|
||||
emails = await github.User.Email.GetAll();
|
||||
Assert.DoesNotContain(testEmailAddress, emails.Select(x => x.Email));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user