public async Task EnsuresNonNullArguments()
            {
                var client = new ObservableFollowersClient(Substitute.For<IGitHubClient>());

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null).ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("").ToTask());
            }
Ejemplo n.º 2
0
        public ObservableUsersClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.User;

            Followers = new ObservableFollowersClient(client);
        }
        public ObservableUsersClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.User;

            Followers = new ObservableFollowersClient(client);
            Email = new ObservableUserEmailsClient(client);
        }
            public void RequestsTheCorrectUrl()
            {
                var githubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableFollowersClient(githubClient);

                client.GetAllFollowing("alfhenrik");

                githubClient.Connection.Received(1).Get<List<User>>(
                    new Uri("users/alfhenrik/following", UriKind.Relative), null, null);
            }
            public void RequestsTheCorrectUrl()
            {
                var githubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableFollowersClient(githubClient);

                client.GetAllFollowingForCurrent();

                githubClient.Connection.Received(1).Get<List<User>>(
                    new Uri("user/following", UriKind.Relative), Args.EmptyDictionary, null);
            }
            public void RequestsTheCorrectUrl()
            {
                var githubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableFollowersClient(githubClient);

                client.GetFollowingForCurrent();

                githubClient.Connection.GetAsync<IReadOnlyList<User>>(
                    new Uri("user/following", UriKind.Relative), null, null);
            }
        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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 10
0
        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 void IsFollowingForCurrentFromClientUserFollowers()
            {
                var githubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableFollowersClient(githubClient);

                client.IsFollowingForCurrent("alfhenrik");

                githubClient.User.Followers.Received()
                    .IsFollowingForCurrent("alfhenrik");
            }
            public async Task EnsuresNonNullArguments()
            {
                var client = new ObservableFollowersClient(Substitute.For<IGitHubClient>());

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.IsFollowing(null, "alfhenrik-test").ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() => client.IsFollowing("", "alfhenrik-test").ToTask());
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.IsFollowing("alfhenrik", null).ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() => client.IsFollowing("alfhenrik", "").ToTask());
            }
            public async Task EnsuresNonNullArguments()
            {
                var client = new ObservableFollowersClient(Substitute.For<IGitHubClient>());

                await AssertEx.Throws<ArgumentNullException>(async () => await client.GetFollowing(null));
                await AssertEx.Throws<ArgumentException>(async () => await client.GetFollowing(""));
            }
            public TheGetAllMethod()
            {
                var github = Helper.GetAuthenticatedClient();

                _followersClient = new ObservableFollowersClient(github);
            }