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); }
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); }
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); }
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); }
public async Task GetFileContent_ShaIsNull_ThrowsArgumentNullException() { var sut = new RepositoryRepository(_requestFactory); await Assert.ThrowsAsync <ArgumentNullException>(() => sut.GetFileContent(0, null, "filePath")); }