Beispiel #1
0
            public void FalseEqual()
            {
                Univercity U        = new Univercity("test");
                IGroup     group    = new Group(new NumberGroup(Specialty.Service, DateTime.Now.Year));
                var        ng       = group.NumberGroup;
                var        id1      = new Id(ng, new Id());
                var        id2      = new Id(ng, new Id());
                IStudent   student1 = new Student(new FullName("test", "test", "test"), new DateTime(2000, 12, 14), id1);
                IStudent   student2 = new Student(new FullName("test", "test", "test"), new DateTime(2000, 12, 14), id2);

                U.AddGroup(group);
                group.AddStudent(student1);
                group.AddStudent(student2);
                var result = student1.Equals(student2);

                Assert.IsFalse(result);
            }
Beispiel #2
0
            public void AddStudent()
            {
                Univercity U        = new Univercity("test");
                IGroup     group    = new Group(new NumberGroup(Specialty.Service, DateTime.Now.Year));
                var        ng       = group.NumberGroup;
                var        id       = new Id(ng, new Id());
                IStudent   student1 = new Student(new FullName("test", "test", "test"), new DateTime(2000, 12, 14), id);
                IStudent   student2 = new Student(new FullName("test", "test", "test"), new DateTime(2000, 12, 14), id);
                int        result   = 2;

                U.AddGroup(group);
                group.AddStudent(student1);
                group.AddStudent(student2);

                CollectionAssert.Contains(group.Students, student1);
                CollectionAssert.Contains(group.Students, student2);
                Assert.AreEqual(group.Students.Count, result);
            }
Beispiel #3
0
            public void MoveToGroupSession()
            {
                Univercity U       = new Univercity("test");
                ISession   session = new Session(SessionType.Winter, DateTime.Now.Year);
                ISubject   subject = new Subject("test", SubjectType.Credited);
                IGroup     group   = new Group(new NumberGroup(Specialty.Service, DateTime.Now.Year));
                var        ng      = group.NumberGroup;
                var        id      = new Id(ng, new Id());
                IStudent   student = new Student(new FullName("test", "test", "test"), new DateTime(2000, 12, 14), id);
                Assessment a       = Assessment.Four;

                U.Groups.Add(group);
                group.AddStudent(student);
                U.Sessions.Add(session);
                U.Subjects.Add(subject);
                //        session.AddSubjects(student, U.Subjects);
                session.MoveToSubjectAssessment(student, subject, a);
                var result = student.Subjects.Find(s => s.Equals(subject)).Assessment;

                ReferenceEquals(a, result);
            }
Beispiel #4
0
            public void AddSubject()
            {
                Univercity U        = new Univercity("test");
                ISession   session  = new Session(SessionType.Winter, DateTime.Now.Year);
                ISubject   subject1 = new Subject("test", SubjectType.Credited);
                ISubject   subject2 = new Subject("test2", SubjectType.Credited);
                IGroup     group    = new Group(new NumberGroup(Specialty.Service, DateTime.Now.Year));
                var        ng       = group.NumberGroup;
                var        id       = new Id(ng, new Id());
                IStudent   student  = new Student(new FullName("test", "test", "test"), new DateTime(2000, 12, 14), id);
                int        result   = 2;

                U.Groups.Add(group);
                group.AddStudent(student);
                U.Sessions.Add(session);
                U.Subjects.Add(subject1);
                U.Subjects.Add(subject2);
                //      session.AddSubjects(student, U.Subjects);

                Assert.AreEqual(session.Subjects.Count, result);
            }