public void PostsToCorrectUrl()
            {
                var issueUpdate = new IssueUpdate();
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                client.Update("fake", "repo", 42, issueUpdate);

                connection.Received().Patch<Issue>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42"),
                    issueUpdate);
            }
Exemplo n.º 2
0
            public async Task EnsuresArgumentsNotNull()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                AssertEx.Throws<ArgumentNullException>(async () => await
                    client.Update(null, "name", 1, new IssueUpdate()));
                AssertEx.Throws<ArgumentNullException>(async () => await
                    client.Update("", "name", 1, new IssueUpdate()));
                AssertEx.Throws<ArgumentNullException>(async () => await
                    client.Update("owner", null, 1, new IssueUpdate()));
                AssertEx.Throws<ArgumentNullException>(async () => await
                    client.Update("owner", "", 1, new IssueUpdate()));
                AssertEx.Throws<ArgumentNullException>(async () => await
                    client.Update("owner", "name", 1, null));
            }