Esempio n. 1
0
        private List <Student> GetStudentsSortedById()
        {
            StudentAccess  context        = new StudentAccess();
            SortStudents   studentsSort   = new SortStudents();
            List <Student> sortedStudents = studentsSort.GenerateSortedList(context.GetAll());

            return(sortedStudents);
        }
Esempio n. 2
0
        public void SortStudentFail()
        {
            List <Student> toSort            = new List <Student>();
            Student        firstTestStudent  = new Student();
            Student        secondTestStudent = new Student();
            Student        thirdTestStudent  = new Student();

            firstTestStudent.Id  = 4;
            secondTestStudent.Id = 2;
            thirdTestStudent.Id  = 3;
            toSort.Add(firstTestStudent);
            toSort.Add(secondTestStudent);
            toSort.Add(thirdTestStudent);
            List <Student> expectedList = new List <Student>();

            expectedList.Add(secondTestStudent);
            expectedList.Add(firstTestStudent);
            expectedList.Add(thirdTestStudent);
            SortStudents sort = new SortStudents();

            Assert.IsFalse(expectedList.SequenceEqual(sort.GenerateSortedList(toSort)));
        }