public async Task GetStatus_ResultsPerPageIsLessThanMinimum_ThrowsArgumentOutOfRangeException()
        {
            var sut = new CommitRepository(_requestFactory);

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(
                () => sut.GetStatus(0, "commitSha", resultsPerPage: uint.MinValue));
        }
        public async Task GetStatus_ValidParameters_SetsCorrectResourceAndMethod()
        {
            var sut = new CommitRepository(_requestFactory);

            await sut.GetStatus(0, "commitSha");

            _requestFactory.Received()
            .Create("projects/{projectId}/repository/commits/{commitSha}/statuses", Method.Get);
        }
        public async Task GetStatus_ValidParameters_AddsProjectIdUrlSegment()
        {
            const uint expected = 0;
            var        sut      = new CommitRepository(_requestFactory);

            await sut.GetStatus(expected, "commitSha");

            _request.Received().AddUrlSegment("projectId", expected);
        }
        public async Task GetStatus_ValidParameters_AddsCommitShaUrlSegment()
        {
            const string expected = "commitSha";
            var          sut      = new CommitRepository(_requestFactory);

            await sut.GetStatus(0, expected);

            _request.Received().AddUrlSegment("commitSha", expected);
        }
        public async Task GetStatus_StageIsSet_AddsStageParameter()
        {
            const string expected = "stage";
            var          sut      = new CommitRepository(_requestFactory);

            await sut.GetStatus(0, "commitSha", stage : expected);

            _request.Received().AddParameterIfNotNull("stage", expected);
        }
        public async Task GetStatus_ResultsPerPageIsSet_AddsPerPageParameter()
        {
            const uint expected = 5;
            var        sut      = new CommitRepository(_requestFactory);

            await sut.GetStatus(0, "commitSha", resultsPerPage : expected);

            _request.Received().AddParameter("per_page", expected);
        }
        public async Task GetStatus_AllIsSet_AddsAllParameter()
        {
            const bool expected = true;
            var        sut      = new CommitRepository(_requestFactory);

            await sut.GetStatus(0, "commitSha", all : expected);

            _request.Received().AddParameterIfNotNull("all", expected);
        }
        public async Task GetStatus_CommitShaIsNull_ThrowsArgumentNullException()
        {
            var sut = new CommitRepository(_requestFactory);

            await Assert.ThrowsAsync <ArgumentNullException>(() => sut.GetStatus(0, null));
        }