public void SearchAdminPaination_Return_10_If_UserName_Exists() { var userName = "******"; for (int i = 0; i < 10; i++) { Admin admin = InitFakeEntity.GetFakeAdmin(); admin.UserName = userName + i; UsingDbContext(ctx => ctx.Admin.Add(admin)); } var list = UsingDbContext(ctx => ctx.Admin.Where(x => x.UserName.Contains(userName)).Count()); list.ShouldBe(10); var result = _iAdminAppSerice.SearchAdminPaination(1, null, userName); result.CurrentPage.ShouldBe(1); result.ListData.Count.ShouldBe(10); result.TotalPages.ShouldBe(1); }