Пример #1
0
        public void GetPagingInfo_Sucess()
        {
            // arrange
            _mockHeaderManager.Setup(x => x.Get <int>(ResponseHeader.TotalCount)).Returns(100);
            _mockHeaderManager.Setup(x => x.Get <int>(ResponseHeader.PageSize)).Returns(10);

            var service = new ServiceBaseTestObject(
                _mockHeaderManager.Object,
                _mockModelMapper.Object,
                _mockRateLimit.Object);

            // act
            var result = service.GetPagingInfoTestMethod();

            // assert
            Assert.NotNull(result);
        }
Пример #2
0
        public void GetPagingInfo_CountsCorrect()
        {
            // arrange
            const int TOTAL_COUNT = 100;
            const int PAGE_SIZE   = 10;

            _mockHeaderManager.Setup(x => x.Get <int>(ResponseHeader.TotalCount)).Returns(TOTAL_COUNT);
            _mockHeaderManager.Setup(x => x.Get <int>(ResponseHeader.PageSize)).Returns(PAGE_SIZE);

            var service = new ServiceBaseTestObject(
                _mockHeaderManager.Object,
                _mockModelMapper.Object,
                _mockRateLimit.Object);

            // act
            var result = service.GetPagingInfoTestMethod();

            // assert
            Assert.Equal(TOTAL_COUNT, result.TotalCount);
            Assert.Equal(PAGE_SIZE, result.PageSize);
        }