public void GetAllAdmin__Should_Return_Correct_Number_Of_Records() { for (int i = 0; i < 8; i++) { Admin admin = InitFakeEntity.GetFakeAdmin(); admin.UserName = admin.UserName + i.ToString(); UsingDbContext(ctx => ctx.Admin.Add(admin)); } var count = UsingDbContext(ctx => ctx.Admin.Count()); var result = _iAdminAppSerice.GetAllAdmin(1); result.ListData.Count.ShouldBe(count); result.CurrentPage.ShouldBe(1); result.TotalPages.ShouldBe(1); }
public async Task <IActionResult> GetAdmin() { var admins = await _adminAppService.GetAllAdmin(); return(Ok(admins)); }