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) ); }
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)); }
public async Task <IActionResult> GetModules() { var modules = await _modulesService.GetAll(); return(Ok(modules)); }