public async Task GetDiff_ValidParameters_SetsCorrectResourceAndMethod() { var sut = new CommitRepository(_requestFactory); await sut.GetDiff(0, "commitSha"); _requestFactory.Received().Create("projects/{projectId}/repository/commits/{commitSha}/diff", Method.Get); }
public async Task GetDiff_ValidParameters_AddsCommitShaUrlSegment() { const string expected = "commitSha"; var sut = new CommitRepository(_requestFactory); await sut.GetDiff(0, expected); _request.Received().AddUrlSegment("commitSha", expected); }
public async Task GetDiff_ValidParameters_AddsProjectIdUrlSegment() { const uint expected = 0; var sut = new CommitRepository(_requestFactory); await sut.GetDiff(expected, "commitSha"); _request.Received().AddUrlSegment("projectId", expected); }
public async Task GetDiff_CommitShaIsNull_ThrowsArgumentNullException() { var sut = new CommitRepository(_requestFactory); await Assert.ThrowsAsync <ArgumentNullException>(() => sut.GetDiff(0, null)); }