Esempio n. 1
0
        public void ShowLessonsForRoomTest()
        {
            Admin    admin    = new Admin();
            Register register = new Register(admin);
            Teacher  teacher  = new Teacher("Name", "Email", "Password", User.Privilege.teacher);
            DateTime time1    = new DateTime(2017, 12, 12);
            DateTime time2    = new DateTime(2018, 12, 12);
            DateTime time3    = new DateTime(2019, 12, 12);
            Course   course   = new Course("Name", teacher, time1, time1, 5);
            Room     room     = new Room("Room");



            Lesson lesson1 = new Lesson(course, time1, time1, room);
            Lesson lesson2 = new Lesson(course, time2, time2, room);
            Lesson lesson3 = new Lesson(course, time3, time3, room);

            register.AddCourse(course);
            register.AddRoom(room);
            register.AddLesson(lesson1);
            register.AddLesson(lesson2);
            register.AddLesson(lesson3);

            Assert.AreEqual(register.GetLessonsRoom(room).Contains(lesson1), true);
            Assert.AreEqual(register.GetLessonsRoom(room).Contains(lesson2), true);
            Assert.AreEqual(register.GetLessonsRoom(room).Contains(lesson3), true);
        }
Esempio n. 2
0
        public void AddRoomToRegistry()
        {
            Admin    admin    = new Admin();
            Register register = new Register(admin);
            Room     room     = new Room("Room1", 5);

            register.AddRoom(room);

            Assert.AreEqual(register.Rooms.Count, 1);
        }
Esempio n. 3
0
        public void SaveRoomToXmlFileTest()
        {
            Admin    admin    = new Admin();
            Register register = new Register(admin);
            Room     room     = new Room("sal 1");

            register.AddRoom(room);
            register.SaveRooms();
            register       = new Register();
            register.Rooms = register.LoadRooms();

            Assert.AreEqual(register.Rooms.Count, 1);
            Assert.AreEqual(register.Rooms[0].Name, "sal 1");
        }