public async Task Search_ResultsPerPageIsGreaterThanMaximum_ThrowsArgumentOutOfRangeException() { var sut = new NamespaceRepository(_requestFactory); await Assert.ThrowsAsync <ArgumentOutOfRangeException>( () => sut.Search("search", resultsPerPage: uint.MaxValue)); }
public async Task Search_ValidParameters_SetsCorrectResourceAndMethod() { var sut = new NamespaceRepository(_requestFactory); await sut.Search("search"); _requestFactory.Received().Create("namespaces", Method.Get); }
public async Task Search_PageIsSet_AddsPageParameter() { const uint expected = 5; var sut = new NamespaceRepository(_requestFactory); await sut.Search("search", expected); _request.Received().AddParameter("page", expected); }
public async Task Search_ValidParameters_AddsSearchParameter() { const string expected = "search"; var sut = new NamespaceRepository(_requestFactory); await sut.Search(expected); _request.Received().AddParameter("search", expected); }
public async Task Search_PageIsLessThanMinimum_ThrowsArgumentOutOfRangeException() { var sut = new NamespaceRepository(_requestFactory); await Assert.ThrowsAsync <ArgumentOutOfRangeException>(() => sut.Search("search", uint.MinValue)); }
public async Task Search_SearchIsNull_ThrowsArgumentNullException() { var sut = new NamespaceRepository(_requestFactory); await Assert.ThrowsAsync <ArgumentNullException>(() => sut.Search(null)); }