Exemplo n.º 1
0
        public async Task GetFunctions()
        {
            var itemsPerPage = 10;
            var pageNumber   = 1;

            var response = await _securityData.GetFunctions(itemsPerPage, pageNumber);

            var expected = _mapper.Map <AccessFunction[]>(_dbFaker.Functions
                                                          .OrderBy(l => l.Name).Skip((pageNumber - 1) * itemsPerPage).Take(itemsPerPage).ToArray());

            CollectionAssert.AreEqual(expected, response.AccessFunctions, new FunctionComparer());
            _mock.Verify(
                data => data.GetFunctions(itemsPerPage, pageNumber, ""), () => Times.Exactly(1));
        }
Exemplo n.º 2
0
        public List <FunctionInfo> GetFunctions(string roleIDs, string typeID)
        {
            List <FunctionInfo> result = new List <FunctionInfo>();

            IFunctionService     service = CreateSubClient();
            ICommunicationObject comm    = service as ICommunicationObject;

            comm.Using(client =>
            {
                result = service.GetFunctions(roleIDs, typeID);
            });

            return(result);
        }
Exemplo n.º 3
0
        public async Task <IActionResult> GetFunctions(int per_page, int page, string mask)
        {
            var result = _securityService.GetFunctions(per_page, page, mask);

            return(Ok(await result));
        }