示例#1
0
        public async Task GetFileContent_ValidParameters_SetsCorrectResourceAndMethod()
        {
            var sut = new RepositoryRepository(_requestFactory);

            await sut.GetFileContent(0, "sha", "filePath");

            _requestFactory.Received().Create("projects/{projectId}/repository/blobs/{sha}", Method.Get);
        }
示例#2
0
        public async Task GetFileContent_ValidParameters_AddsShaUrlSegment()
        {
            const string expected = "sha";
            var          sut      = new RepositoryRepository(_requestFactory);

            await sut.GetFileContent(0, expected, "filePath");

            _request.Received().AddUrlSegment("sha", expected);
        }
示例#3
0
        public async Task GetFileContent_ValidParameters_AddsFilePathParameter()
        {
            const string expected = "filePath";
            var          sut      = new RepositoryRepository(_requestFactory);

            await sut.GetFileContent(0, "sha", expected);

            _request.Received().AddParameter("filepath", expected);
        }
示例#4
0
        public async Task GetFileContent_ValidParameters_AddsProjectIdUrlSegment()
        {
            const uint expected = 0;
            var        sut      = new RepositoryRepository(_requestFactory);

            await sut.GetFileContent(expected, "sha", "filePath");

            _request.Received().AddUrlSegment("projectId", expected);
        }
示例#5
0
        public async Task GetFileContent_ShaIsNull_ThrowsArgumentNullException()
        {
            var sut = new RepositoryRepository(_requestFactory);

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