コード例 #1
0
        public async Task When_GettingAllModules_Expect_CorrectModules()
        {
            var actualModules = await _modulesService.GetAll();

            Assert.Collection(actualModules,
                              m => Assert.Equal("Operating Systems", m.Name),
                              m => Assert.Equal("Databases", m.Name),
                              m => Assert.Equal("Analysis of Algorithms", m.Name),
                              m => Assert.Equal("Cyber Security", m.Name)
                              );
        }
コード例 #2
0
        public async System.Threading.Tasks.Task <JsonResult> GetUsersListAsync()
        {
            string         pageNumber = string.IsNullOrWhiteSpace(Request["pageNumber"]) ? "0" : Request["pageNumber"];
            string         pageSize   = string.IsNullOrWhiteSpace(Request["pageSize"]) ? "20" : Request["pageSize"];
            List <MeunDto> Meunlist   = new List <MeunDto>();
            var            Meun       = (await _iMeunService.GetAll(new PagedResultRequestDto {
                MaxResultCount = int.MaxValue
            })).Items;                                                                                                  //Paging not implemented yet
            int totaldata             = Meun.Count();

            Meunlist = Meun.Skip(int.Parse(pageNumber) * int.Parse(pageSize)).Take(int.Parse(pageSize)).ToList();
            var result = new { total = totaldata, rows = Meunlist };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public async Task <IActionResult> GetModules()
        {
            var modules = await _modulesService.GetAll();

            return(Ok(modules));
        }