Beispiel #1
0
        public async Task GetBlobContent_ValidParameters_SetsCorrectResourceAndMethod()
        {
            var sut = new RepositoryRepository(_requestFactory);

            await sut.GetBlobContent(0, "sha");

            _requestFactory.Received().Create("projects/{projectId}/repository/raw_blobs/{sha}", Method.Get);
        }
Beispiel #2
0
        public async Task GetBlobContent_ValidParameters_AddsProjectIdUrlSegment()
        {
            const uint expected = 0;
            var        sut      = new RepositoryRepository(_requestFactory);

            await sut.GetBlobContent(expected, "sha");

            _request.Received().AddUrlSegment("projectId", expected);
        }
Beispiel #3
0
        public async Task GetBlobContent_ValidParameters_AddsShaUrlSegment()
        {
            const string expected = "sha";
            var          sut      = new RepositoryRepository(_requestFactory);

            await sut.GetBlobContent(0, expected);

            _request.Received().AddUrlSegment("sha", expected);
        }
Beispiel #4
0
        public async Task GetBlobContent_ShaIsNull_ThrowsArgumentNullException()
        {
            var sut = new RepositoryRepository(_requestFactory);

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