Beispiel #1
0
        public void FilterListLecturersIfInpuListIsNullNullReferenceExceptionThrow()
        {
            // arrange
            string          input     = "Sen";
            List <Lecturer> inputList = null;

            // act
            FormsMethods.FilterList(inputList, input);
        }
Beispiel #2
0
        public void FilterListStudentsIfInpuListIsNullNullReferenceExceptionThrow()
        {
            // arrange
            string         input     = "33";
            List <Student> inputList = null;

            // act
            FormsMethods.FilterList(inputList, input);
        }
Beispiel #3
0
        public void FilterListLecturerstWhenResultsIsNullNullArgExceptionThrow()
        {
            // arrange
            List <Lecturer> list = new List <Lecturer>()
            {
                new Lecturer("John", "Mall", "19 avenue", "Cork", "Ireland",
                             "0987U", "345778", "john@gmail", 45, 32435M, "Computer Science")
            };
            string subString = "bac";

            // act
            FormsMethods.FilterList(list, subString);
        }
Beispiel #4
0
        public void FilterListStudentstWhenResultsIsNullNullArgExceptionThrow()
        {
            // arrange
            List <Student> list = new List <Student>()
            {
                new Student("John", "Mall", "19 avenue", "Cork", "Ireland",
                            "0987U", "345778", "john@gmail", Status.PostGrad, 45, "Computer Science")
            };
            string subString = "ad";

            // act
            FormsMethods.FilterList(list, subString);
        }
Beispiel #5
0
        public void FilterListLecturersIfTheInputIsNotNumberResultFilteredListBySurname()
        {
            List <Lecturer> listOfLecturers = new List <Lecturer>()
            {
                new Lecturer("Mark", "Carling", "19 street", "Dublin", "Ireland",
                             "0897Y", "23456546", "mark@gmail", 12, 32435M, "Science"),
                new Lecturer("John", "Thompson", "19 street", "Dublin", "Ireland",
                             "0897Y", "23456546", "john@gmail", 55, 32453M, "Arts"),
                new Lecturer("Tommy", "Barrington", "19 street", "Dublin", "Ireland",
                             "0897Y", "23456546", "mark@gmail", 21, 12324M, "Maths")
            };
            string   input       = "Ba";
            Lecturer objExpected = listOfLecturers[2];

            //act
            List <Lecturer> filtList = FormsMethods.FilterList(listOfLecturers, input);

            // assert
            CollectionAssert.Contains(filtList, objExpected);
        }
Beispiel #6
0
        public void FilterListStudentsIfTheInputIsNotNumberResultFilteredListBySurname()
        {
            List <Student> listOfStudent = new List <Student>()
            {
                new Student("Mark", "Carling", "19 street", "Dublin", "Ireland",
                            "0897Y", "23456546", "mark@gmail", Status.UnderGrad, 12, "Science"),
                new Student("John", "Thompson", "19 street", "Dublin", "Ireland",
                            "0897Y", "23456546", "john@gmail", Status.UnderGrad, 55, "Arts"),
                new Student("Tommy", "Barrington", "19 street", "Dublin", "Ireland",
                            "0897Y", "23456546", "mark@gmail", Status.PostGrad, 21, "Maths")
            };
            string  input       = "Th";
            Student objExpected = listOfStudent[1];

            //act
            List <Student> filtList = FormsMethods.FilterList(listOfStudent, input);

            // assert
            CollectionAssert.Contains(filtList, objExpected);
        }