wireup delete API

This commit is contained in:
Brendan Forster
2014-07-08 10:25:44 +09:30
parent 97995a769a
commit 2cd53f061d
3 changed files with 49 additions and 1 deletions
@@ -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));
}
}
}