public async Task CanGetEmail() { var github = Helper.GetAuthenticatedClient(); var client = new ObservableUserEmailsClient(github); var email = await client.GetAll(); Assert.NotNull(email); }
public void GetsCorrectUrlWithApiOption() { var github = Substitute.For<IGitHubClient>(); var client = new ObservableUserEmailsClient(github); client.GetAll(ApiOptions.None); github.Connection.Received(1).Get<List<EmailAddress>>(_expectedUri, Arg.Is<Dictionary<string, string>>(dictionary => dictionary.Count == 0), null); }
public void GetsCorrectUrl() { var expectedUri = new Uri("user/emails", UriKind.Relative); var github = Substitute.For<IGitHubClient>(); var client = new ObservableUserEmailsClient(github); client.GetAll(); github.Connection.Received(1).GetAsync<List<EmailAddress>>(expectedUri); }
public async Task CanGetEmail() { var github = new GitHubClient(new ProductHeaderValue("OctokitTests")) { Credentials = Helper.Credentials }; var client = new ObservableUserEmailsClient(github); var email = await client.GetAll(); Assert.NotNull(email); }