コード例 #1
0
        public async Task EnsuresArgumentsNotNull()
        {
            var connection = Substitute.For <IApiConnection>();
            var client     = new IssueCommentsClient(connection);

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

            await AssertEx.Throws <ArgumentException>(async() => await client.GetForRepository("", "name"));

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

            await AssertEx.Throws <ArgumentException>(async() => await client.GetForRepository("owner", ""));
        }
コード例 #2
0
        public void RequestsCorrectUrl()
        {
            var connection = Substitute.For <IApiConnection>();
            var client     = new IssueCommentsClient(connection);

            client.GetForRepository("fake", "repo");

            connection.Received().GetAll <IssueComment>(Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/issues/comments"));
        }