Пример #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"));
        }