Example #1
0
        public void GetPaged_calls_dataProvider_and_returns_apiresponse()
        {
            //  Arrange
            int take = 10;
            int skip = 0;
            var data = new PagedResponse <BranchDTO>();

            _dataProvider.GetPagedBranches(take, skip).Returns(data);

            //  Act
            var result = _controller.GetPaged(take, skip);

            //  Assert
            _dataProvider.Received(1).GetPagedBranches(Arg.Is(take), Arg.Is(skip));
            Assert.IsInstanceOf <OkNegotiatedContentResult <ApiResponse <IList <BranchDTO> > > >(result);
        }