public async Task CanGetEmail()
        {
            var github = Helper.GetAuthenticatedClient();

            var client = new ObservableUserEmailsClient(github);

            var email = await client.GetAll();
            Assert.NotNull(email);
        }
        public ObservableUsersClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.User;

            Followers = new ObservableFollowersClient(client);
            Email = new ObservableUserEmailsClient(client);
        }
            public void CallsAddOnClient()
            {
                var github = Substitute.For<IGitHubClient>();
                var client = new ObservableUserEmailsClient(github);
                string email = "*****@*****.**";

                client.Add(email);

                github.User.Email.Received(1).Add(Arg.Is(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);
        }
        public ObservableUsersClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.User;

            Followers      = new ObservableFollowersClient(client);
            Email          = new ObservableUserEmailsClient(client);
            Keys           = new ObservableUserKeysClient(client);
            Administration = new ObservableUserAdministrationClient(client);
        }
        public ObservableUsersClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.User;

            Followers = new ObservableFollowersClient(client);
            Email = new ObservableUserEmailsClient(client);
            Keys = new ObservableUserKeysClient(client);
            Administration = new ObservableUserAdministrationClient(client);
        }
Exemple #9
0
        public ObservableUsersClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, nameof(client));

            _client = client.User;

            Followers      = new ObservableFollowersClient(client);
            Email          = new ObservableUserEmailsClient(client);
            GitSshKey      = new ObservableUserKeysClient(client);
            GpgKey         = new ObservableUserGpgKeysClient(client);
            Administration = new ObservableUserAdministrationClient(client);
        }
        public ObservableUsersClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.User;

            Followers = new ObservableFollowersClient(client);
            Email     = new ObservableUserEmailsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            Keys = new ObservableUserKeysClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            GitSshKey      = new ObservableUserKeysClient(client);
            GpgKey         = new ObservableUserGpgKeysClient(client);
            Administration = new ObservableUserAdministrationClient(client);
        }
        public ObservableUsersClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.User;

            Followers = new ObservableFollowersClient(client);
            Email = new ObservableUserEmailsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            Keys = new ObservableUserKeysClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            GitSshKey = new ObservableUserKeysClient(client);
            GpgKey = new ObservableUserGpgKeysClient(client);
            Administration = new ObservableUserAdministrationClient(client);
        }
        public ObservableUserEmailsClientTests()
        {
            var github = Helper.GetAuthenticatedClient();

            _emailClient = new ObservableUserEmailsClient(github);
        }