Exemplo n.º 1
0
        public void setNewSemesterForClassTest()
        {
            Semester semester1 = new Semester { Id = 1, Number = 1 };
            Semester semester2 = new Semester { Id = 2, Number = 2 };
            Education education = new Education { Name = "DMU", Semesters = new List<Semester> { semester1, semester2 }, NumberOfSemesters = 2 };
            ClassModel model = new ClassModel { Education = education, ClassName = "12T" };

            DateTime start = DateTime.Today;
            DateTime finish = DateTime.Today.AddDays(30);

            SkemaSystem.Service.Service service = new SkemaSystem.Service.Service();

            service.setNewSemesterForClass(model, semester1, start, finish);

            Assert.AreEqual(start, model.ActiveSchemes[0].SemesterStart);
            Assert.AreEqual(finish, model.ActiveSchemes[0].SemesterFinish);
        }
Exemplo n.º 2
0
        public void Init()
        {
            Teachers = new List<Teacher>();
            Subjects = new List<Subject>();

            Subjects.Add(new Subject { Name = "ITO" });
            Subjects.Add(new Subject { Name = "SK" });
            Subjects.Add(new Subject { Name = "SD" });
            Subjects.Add(new Subject { Name = "CNDS" });

            Teachers.Add(new Teacher { Name = "Hanne" });
            Teachers.Add(new Teacher { Name = "Karsten" });
            Teachers.Add(new Teacher { Name = "Jorn" });
            Teachers.Add(new Teacher { Name = "Kaj" });

            Semester = new Semester { Number = 1 };

            List<SemesterSubjectBlock> blocks = new List<SemesterSubjectBlock>();
            blocks.Add(new SemesterSubjectBlock { Subject = Subjects[0], BlocksCount = 20 });
            blocks.Add(new SemesterSubjectBlock { Subject = Subjects[1], BlocksCount = 40 });
            blocks.Add(new SemesterSubjectBlock { Subject = Subjects[2], BlocksCount = 35 });

            Semester.Blocks = blocks;
        }
Exemplo n.º 3
0
        public void setNewSemesterForClass(ClassModel model, Semester semester, DateTime start, DateTime finish)
        {
            Scheme scheme = new Scheme { ClassModel = model, Semester = semester, SemesterStart = start, SemesterFinish = finish };

            model.ActiveSchemes.Add(scheme);
        }