コード例 #1
0
        public async Task GetAll_ValidParameters_SetsCorrectResourceAndMethod()
        {
            var sut = new NamespaceRepository(_requestFactory);

            await sut.GetAll();

            _requestFactory.Received().Create("namespaces", Method.Get);
        }
コード例 #2
0
        public async Task GetAll_ResultsPerPageIsSet_AddsPerPageParameter()
        {
            const uint expected = 5;
            var        sut      = new NamespaceRepository(_requestFactory);

            await sut.GetAll(resultsPerPage : expected);

            _request.Received().AddParameter("per_page", expected);
        }
コード例 #3
0
        public async Task GetAll_ResultsPerPageIsLessThanMinimum_ThrowsArgumentOutOfRangeException()
        {
            var sut = new NamespaceRepository(_requestFactory);

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(() => sut.GetAll(resultsPerPage: uint.MinValue));
        }