Ejemplo n.º 1
0
        public async Task EnsuresArgumentsNotNull()
        {
            var connection = Substitute.For <IApiConnection>();
            var client     = new PullRequestReviewCommentsClient(connection);

            await Assert.ThrowsAsync <ArgumentNullException>(() => client.Delete(null, "fakeRepoName", 1));

            await Assert.ThrowsAsync <ArgumentException>(() => client.Delete("", "fakeRepoName", 1));

            await Assert.ThrowsAsync <ArgumentNullException>(() => client.Delete("fakeOwner", null, 1));

            await Assert.ThrowsAsync <ArgumentException>(() => client.Delete("fakeOwner", "", 1));
        }
        public async Task PostsToCorrectUrlWithRepositoryId()
        {
            var connection = Substitute.For <IApiConnection>();
            var client     = new PullRequestReviewCommentsClient(connection);

            await client.Delete(1, 13);

            connection.Received().Delete(Arg.Is <Uri>(u => u.ToString() == "repositories/1/pulls/comments/13"));
        }
Ejemplo n.º 3
0
        public void PostsToCorrectUrl()
        {
            var connection = Substitute.For <IApiConnection>();
            var client     = new PullRequestReviewCommentsClient(connection);

            client.Delete("fakeOwner", "fakeRepoName", 13);

            connection.Received().Delete(Arg.Is <Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/comments/13"));
        }
        public async Task PostsToCorrectUrl()
        {
            var connection = Substitute.For <IApiConnection>();
            var client     = new PullRequestReviewCommentsClient(connection);

            await client.Delete("owner", "name", 13);

            connection.Received().Delete(Arg.Is <Uri>(u => u.ToString() == "repos/owner/name/pulls/comments/13"));
        }