Example #1
0
        public void GetAllStudentList_Should_Return_Correct_Number_Of_Records()
        {
            //Arrange:Insert Data
            for (int i = 0; i < 10; i++)
            {
                Student student = InitFakeEntity.GetFakeStudent();
                student.UserName = "******" + i;
                UsingDbContext(ctx => ctx.Student.Add(student));
            }
            var result = _studentAppService.GetAllStudentList(1);

            result.CurrentPage.ShouldBe(1);
            result.TotalPages.ShouldBe(1);
            result.ListData.Count.ShouldBe(10);
        }