Exemplo n.º 1
0
        public async Task Search_ResultsPerPageIsGreaterThanMaximum_ThrowsArgumentOutOfRangeException()
        {
            var sut = new NamespaceRepository(_requestFactory);

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(
                () => sut.Search("search", resultsPerPage: uint.MaxValue));
        }
Exemplo n.º 2
0
        public async Task Search_ValidParameters_SetsCorrectResourceAndMethod()
        {
            var sut = new NamespaceRepository(_requestFactory);

            await sut.Search("search");

            _requestFactory.Received().Create("namespaces", Method.Get);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public async Task Search_ValidParameters_AddsSearchParameter()
        {
            const string expected = "search";
            var          sut      = new NamespaceRepository(_requestFactory);

            await sut.Search(expected);

            _request.Received().AddParameter("search", expected);
        }
Exemplo n.º 5
0
        public async Task Search_PageIsLessThanMinimum_ThrowsArgumentOutOfRangeException()
        {
            var sut = new NamespaceRepository(_requestFactory);

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(() => sut.Search("search", uint.MinValue));
        }
Exemplo n.º 6
0
        public async Task Search_SearchIsNull_ThrowsArgumentNullException()
        {
            var sut = new NamespaceRepository(_requestFactory);

            await Assert.ThrowsAsync <ArgumentNullException>(() => sut.Search(null));
        }