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

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllForMilestone(null, "name", 42));

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllForMilestone("owner", null, 42));
            }
Ejemplo n.º 2
0
            public async Task RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssuesLabelsClient(connection);

                await client.GetAllForMilestone("fake", "repo", 42);

                connection.Received().GetAll <Label>(Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), Args.ApiOptions);
            }
            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssuesLabelsClient(connection);

                await client.GetAllForMilestone(1, 42);

                connection.Received().GetAll <Label>(Arg.Is <Uri>(u => u.ToString() == "repositories/1/milestones/42/labels"), null, "application/vnd.github.symmetra-preview+json", Args.ApiOptions);
            }
Ejemplo n.º 4
0
            public async Task RequestsCorrectUrlWithApiOptions()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssuesLabelsClient(connection);

                var options = new ApiOptions
                {
                    PageCount = 1,
                    StartPage = 1,
                    PageSize  = 1
                };

                await client.GetAllForMilestone("fake", "repo", 42, options);

                connection.Received().GetAll <Label>(Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), options);
            }
Ejemplo n.º 5
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new IssuesLabelsClient(Substitute.For<IApiConnection>());

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForMilestone(null, "name", 42));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForMilestone("owner", null, 42));
            }
Ejemplo n.º 6
0
            public void GetsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesLabelsClient(connection);

                client.GetAllForMilestone("fake", "repo", 42);

                connection.Received().GetAll<Label>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/milestones/42/labels"));
            }
            public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesLabelsClient(connection);

                var options = new ApiOptions
                {
                    PageCount = 1,
                    StartPage = 1,
                    PageSize = 1
                };

                await client.GetAllForMilestone(1, 42, options);

                connection.Received().GetAll<Label>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/milestones/42/labels"), options);
            }