Exemple #1
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new IssuesClient(Substitute.For<IApiConnection>());

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories((ApiOptions)null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories((IssueRequest)null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories(null, new ApiOptions()));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories(new IssueRequest(), null));
            }
            public async Task EnsuresNonNullArguments()
            {
                var client = new IssuesClient(Substitute.For<IApiConnection>());

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories((ApiOptions)null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories((IssueRequest)null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories(null, new ApiOptions()));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories(new IssueRequest(), null));
            }
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssuesClient(connection);

                client.GetAllForOwnedAndMemberRepositories();

                connection.Received().GetAll <Issue>(Arg.Is <Uri>(u => u.ToString() == "user/issues"),
                                                     Arg.Any <Dictionary <string, string> >());
            }
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                client.GetAllForOwnedAndMemberRepositories();

                connection.Received().GetAll<Issue>(Arg.Is<Uri>(u => u.ToString() == "user/issues"),
                    Arg.Any<Dictionary<string, string>>());
            }
            public async Task RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssuesClient(connection);

                await client.GetAllForOwnedAndMemberRepositories();

                connection.Received().GetAll <Issue>(Arg.Is <Uri>(u => u.ToString() == "user/issues"),
                                                     Arg.Any <Dictionary <string, string> >(),
                                                     "application/vnd.github.squirrel-girl-preview+json",
                                                     Args.ApiOptions);
            }
            public async Task RequestsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                await client.GetAllForOwnedAndMemberRepositories();

                connection.Received().GetAll<Issue>(Arg.Is<Uri>(u => u.ToString() == "user/issues"),
                    Arg.Any<Dictionary<string, string>>(),
                    "application/vnd.github.squirrel-girl-preview",
                    Args.ApiOptions);
            }