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

                await AssertEx.Throws <ArgumentNullException>(async() => await client.RemoveFromIssue(null, "name", 42, "label"));

                await AssertEx.Throws <ArgumentNullException>(async() => await client.RemoveFromIssue("owner", null, 42, "label"));

                await AssertEx.Throws <ArgumentNullException>(async() => await client.RemoveFromIssue("owner", "name", 42, null));
            }
            public void DeleteCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssuesLabelsClient(connection);

                client.RemoveFromIssue("fake", "repo", 42, "label");

                connection.Received().Delete(Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/issues/42/labels/label"));
            }
示例#3
0
            public void DeleteCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssuesLabelsClient(connection);

                client.RemoveFromIssue(1, 42, "label");

                connection.Received().Delete(Arg.Is <Uri>(u => u.ToString() == "repositories/1/issues/42/labels/label"));
            }
            public void DeleteCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssuesLabelsClient(connection);

                client.RemoveFromIssue(1, 42, "label");

                connection.Received().Delete <IReadOnlyList <Label> >(Arg.Is <Uri>(u => u.ToString() == "repositories/1/issues/42/labels/label"), "application/vnd.github.symmetra-preview+json");
            }
            public async Task EnsuresNonNullArguments()
            {
                var client = new IssuesLabelsClient(Substitute.For<IApiConnection>());

                await AssertEx.Throws<ArgumentNullException>(async () => await client.RemoveFromIssue(null, "name", 42, "label"));
                await AssertEx.Throws<ArgumentNullException>(async () => await client.RemoveFromIssue("owner", null, 42, "label"));
                await AssertEx.Throws<ArgumentNullException>(async () => await client.RemoveFromIssue("owner", "name", 42, null));
            }
            public void DeleteCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesLabelsClient(connection);

                client.RemoveFromIssue("fake", "repo", 42, "label");

                connection.Received().Delete(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/labels/label"));
            }
            public void DeleteCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesLabelsClient(connection);

                client.RemoveFromIssue(1, 42, "label");

                connection.Received().Delete(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/labels/label"));
            }