Ejemplo n.º 1
0
        public void TestEqualsWithEqualNumbersDifferentNames()
        {
            Student studentFirst = new Student("Elena Hristova", 123);
            Student studentSecond = new Student("Jeni Dacheva", 123);

            Assert.IsTrue(studentFirst.Equals(studentSecond));
        }
Ejemplo n.º 2
0
        public void TestEqualsWithDifferentNumbers()
        {
            Student studentFirst = new Student("Elena Hristova", 123);
            Student studentSecond = new Student("Iva Ivanova", 1233);

            Assert.IsFalse(studentFirst.Equals(studentSecond));
        }
Ejemplo n.º 3
0
        public void TestConstructorNameNormalValue()
        {
            Student student = new Student("Elena Hristova", 123);

            Assert.AreEqual("Elena Hristova", student.Name);
            Assert.AreEqual(123, (int)student.Number);
        }
Ejemplo n.º 4
0
        public void Equals_CompareNotEqualStudents()
        {
            Student student = new Student(1000, "Pesho");
            Student otherStudent = new Student(1020, "Mike");

            Assert.IsFalse(student.Equals(otherStudent));
        }
Ejemplo n.º 5
0
 public void StudentToStringTest()
 {
     Student student = new Student("Pesho Peshov", 11011);
     string expected = "11011: Pesho Peshov";
     string resilt = student.ToString();
     Assert.AreEqual(expected, resilt, "Student.ToString() works incorrectly.");
 }
Ejemplo n.º 6
0
        public static void Main(string[] args)
        {
            //Student pesho = new Student("Pesho");
            //Console.WriteLine(pesho.Number);
            //Student gosho = new Student("Gosho");
            //Console.WriteLine(gosho.Number);
            //Student vlado = new Student("Vlado");
            //Console.WriteLine(vlado.Number);
            //Student kiro = new Student("Kiro");
            //Console.WriteLine(kiro.Number);
            //Student simo = new Student("Simo");
            //Console.WriteLine(simo.Number);

            //List<Student> students = new List<Student>();
            //students.Add(pesho);
            //students.Add(gosho);
            //students.Add(vlado);

            List<Student> students = new List<Student>();
            var student = new Student("Pesho");
            students.Add(student);
            Course course = new Course(students);
            course.Leave(student);
            Console.WriteLine();
        }
Ejemplo n.º 7
0
 public void StudentConstructorNumberTest()
 {
     string name = "Kalin Iliev";
     int uniqueNumber = 11223;
     Student student = new Student(name, uniqueNumber);
     Assert.AreEqual(uniqueNumber, student.UniqueNumber);
 }
Ejemplo n.º 8
0
 public void StudentToStringTest()
 {
     string name = "Kalin Iliev";
     int uniqueNumber = 12456;
     Student student = new Student(name, uniqueNumber);
     Assert.AreEqual("Student Kalin Iliev - Unique Number: 12456", student.ToString());
 }
Ejemplo n.º 9
0
        public void CrateStudent_CrateStudentAndGetItsId()
        {
            uint id = 1000;
            Student student = new Student(1000, "Pesho");

            Assert.AreEqual(id, student.Id);
        }
Ejemplo n.º 10
0
        public void StudentName_GetterAndSetter()
        {
            string name = "Antoan2";
            Student testStudent = new Student(name);

            Assert.AreEqual(name, testStudent.Name);
        }
Ejemplo n.º 11
0
 public void AddStudent_ExpectToBeAdded()
 {
     Student student = new Student("Mitko");
     this.course.AddStudent(student);
     Assert.AreEqual(1, this.course.Students.Count, "The course should have one student added");
     Assert.AreSame(student, this.course.Students[0], "The student must be added");
 }
Ejemplo n.º 12
0
 public void CourseAddStudentExistingStudentTest()
 {
     Course course = new Course("HQPC");
     Student student = new Student("Pesho Peshov", 11011);
     course.AddStudent(student);
     course.AddStudent(student);
 }
Ejemplo n.º 13
0
 public void CourseTestAdd()
 {
     var student = new Student("Gosho Goshov", 12300);
     var course = new Course("Csharp");
     course.AddStudent(student);
     course.AddStudent(student);
 }
Ejemplo n.º 14
0
        public void Course_Minus5IsOutOfRangeIndex()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student student = new Student("Anonymous", 10009);

            mathCourse[-5] = student;
        }
Ejemplo n.º 15
0
        public void CrateStudent_CrateStudentAndGetItsName()
        {
            string name = "Pesho";
            Student student = new Student(1000, "Pesho");

            Assert.AreEqual(name, student.Name);
        }
Ejemplo n.º 16
0
        public void Course_30IsOutOfRangeIndex()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student student = new Student("Anonymous", 10008);

            mathCourse[30] = student;
        }
Ejemplo n.º 17
0
        public void Course_StudentIsExcluded()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student bratPit = new Student("Brat Pit", 10002);
            Student fracescoTotti = new Student("Francesco Totti", 10003);
            Student jessicaAlba = new Student("Jessica Alba", 10004);

            mathCourse[0] = bratPit;
            mathCourse[1] = fracescoTotti;
            mathCourse[2] = jessicaAlba;

            mathCourse.ExcludeParticipant(fracescoTotti);

            bool actual = true;
            for (int index = 0; index < 3; index++)
            {
                if (mathCourse[index] == fracescoTotti)
                {
                    actual = false;
                    break;
                }
            }

            Assert.IsTrue(actual,"Student is not removed from the course.");
        }
Ejemplo n.º 18
0
        public static void Main()
        {
            var stoyanov = new Student("Stoyanov", "54443AZ");
            var petrov = new Student("Petrov", "54444AZ", "no like");
            var mimi = new Student("Mimi", "55221RX", "very cute");

            var students = new List<Student> { stoyanov, petrov, mimi };
            

            var teachers = new List<Teacher> { new Teacher("Gadiov"), new Teacher("Ivanov"), new Teacher("Georgiev") };
            teachers[1].Detail = "The best teacher ever";

            foreach (var teacher in teachers)
            {
                Console.WriteLine("Teacher: " + teacher.Name);
            }

            foreach (var student in students)
            {
                Console.WriteLine("Student: " + student.Name + " - " + student.UniqueClassNum + " - " + student.Detail);
            }

            var history = new Discipline("History", new List<Student>() { stoyanov, petrov, mimi}, 25);
            var mechanics = new Discipline("Mechanics", new List<Student>() { mimi, petrov }, 53, "important discipline");

            var class19A = new SchoolClass("19A", students, teachers);

            var mySchool = new School(new List<SchoolClass>() { class19A });
        }
        static void Main()
        {
            var someSchool = new School();
            var eveningClass = new Class("Level#2");
            var trainer = new Teacher("Mr. NakMan");
            var disciplineClassA = new Discipline("OOP", 2, 2);

            var firstStudent = new Student("Anamalech", 1);
            var thirdStudent = new Student("Corson", 3);
            var secondStudent = new Student("Boruta", 2);
            var forthStudent = new Student("Lucifer", 4);

            //Okay. Let's summon the demons... pardon, Demos!
            someSchool.AddClass(eveningClass);
            eveningClass.AddTeacher(trainer);
            trainer.AddDiscipline(disciplineClassA);

            eveningClass.AddStudent(firstStudent);
            eveningClass.AddStudent(secondStudent);
            eveningClass.AddStudent(thirdStudent);
            eveningClass.AddStudent(forthStudent);

            Console.WriteLine(eveningClass.ToString());
            Console.WriteLine();
        }
Ejemplo n.º 20
0
 public void CreateStudent_StudentNumberIsInRange10000To99999()
 {
     Student student = new Student("Student");
     int studentNumber = student.Number;
     var isNumberValid = 10000 <= studentNumber && studentNumber <= 99999;
     Assert.IsTrue(isNumberValid);
 }
Ejemplo n.º 21
0
 public void CourseTestRemove()
 {
     var student = new Student("Ivan Ivanov", 12300);
     var student1 = new Student("Petkan Ivanov", 12100);
     var course = new Course("Csharp");
     course.AddStudent(student);
     course.RemoveStudent(student1);
 }
Ejemplo n.º 22
0
        public void Student_StudentIsCreated()
        {
            Student student = new Student("Anonymous", 10013);

            Assert.IsNotNull(student, "Studnet not created properly.");
            Assert.AreEqual(student.Name, "Anonymous", "Student name is not what is expected. Expected 'Anonymous.'");
            Assert.AreEqual(student.UniqeNumber, 10013, "Student school number is not wat expected. Expected 10013.");
        }
Ejemplo n.º 23
0
        public void CourseTestRemoveExistentStudent()
        {
            var student = new Student("Ivan Ivanov", 12300);
            var course = new Course("CMS");

            course.AddStudent(student);
            course.RemoveStudent(student);
        }
Ejemplo n.º 24
0
 public void ExcludeStudent_ExpectToBeRemoved()
 {
     Student someStudent = new Student("Student");
     this.course.AddStudent(someStudent);
     Assert.IsTrue(this.course.Students.IndexOf(someStudent) >= 0, "The test student should be added to the course");
     this.course.ExcludeStudent(someStudent);
     Assert.IsTrue(this.course.Students.IndexOf(someStudent) < 0, "The test student must be removed from the course");
 }
Ejemplo n.º 25
0
 public void AddNewStudent_AddTooMuchStudents()
 {
     Course course = new Course("OS", 123);
     Student student = new Student(10000, "Pesho");
     Student studentWithSameID = new Student(10000, "Gosho");
     course.AddNewStudent(student);
     course.AddNewStudent(studentWithSameID);
 }
Ejemplo n.º 26
0
        public void LongStudentName()
        {
            Student student = new Student("Thisstudenthaveuberduberlongname", 12000);

            string result = student.Name;

            Assert.AreEqual("Thisstudenthaveuberduberlongname", result);
        }
Ejemplo n.º 27
0
        public void StudentIdJustInLowerRange()
        {
            Student student = new Student("Marko", 10000);

            int result = student.IdNum;

            Assert.AreEqual(10000, result);
        }
Ejemplo n.º 28
0
        public void OneLetterStudentName()
        {
            Student student = new Student("U", 12000);

            string result = student.Name;

            Assert.AreEqual("U", result);
        }
Ejemplo n.º 29
0
        public void Join(Student student)
        {
            this.students.Add(student);

            if (this.students.Count > MAX_STUDENTS)
            {
                throw new ArgumentOutOfRangeException("Course is already full.");
            }
        }
Ejemplo n.º 30
0
        public void Course_StudentIsAdded()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student student = new Student("Anonymous", 10001);

            mathCourse[0] = student;
            bool actual = (mathCourse[0] == (student));
            Assert.AreEqual(true, actual,"student is not added to the course.");
        }