public void TestConstructor_Exception(string nameSubject, int percent, Type result) { ResetStandart(); Type exception = null; ISubject subject = null; if (nameSubject != null) { subject = new Subject.Subject(nameSubject); } //arrange try { //act var subjectOfTeacher = new SubjectOfTeacher.SubjectOfTeacher(subject, percent); } catch (Exception ex) { //assert exception = ex.GetType(); } finally { Assert.AreEqual(result, exception); } }
public void TestToString(string nameSubject, int numberSubject, string result) { ISubject subject = new Subject.Subject(nameSubject); var numberOfLesson = new NumberOfLesson.NumberOfLesson(subject, numberSubject); Assert.AreEqual(result, numberOfLesson.ToString()); }
public PlainText GenerateReport(Subject.Subject sub, RegistrationNumber reg) { Subject.SubjectSituation situation; situation = sub.GetSituationForStudent(reg); string reportString = situation.ExamGrades.ToString() + "\n" + situation.Attendance.Count.ToString() + "\n" + situation.Lab.ActivityGrade.ToString() + "\n"; PlainText reporttext = new PlainText(reportString); return(reporttext); }
public void Update(Subject.Subject entity) { _subject.Where(p => p.Equals(entity)) .Select(S => { S.SubjectInfo = new Models.Subject.SubjectInformation("Update subject"); return(S); }).ToList(); }
public void Add(Subject.Subject entity) { var result = _subject.FirstOrDefault(p => p.Equals(entity)); if (result != null) { throw new ExistingSubjectException(); } _subject.Add(entity); }
public void Delete(Subject.Subject entity) { var result = _subject.FirstOrDefault(p => p.Equals(entity)); if (result == null) { throw new MissingSubjectException(); } _subject.Remove(entity); }
public void TestToString_True(string nameSubject, string departament, int percent, string toString) { ResetStandart(); //arrange var subject = new Subject.Subject(nameSubject, departament); //act var subjectOfTeacher = new SubjectOfTeacher.SubjectOfTeacher(subject, percent); //assert Assert.AreEqual(toString, subjectOfTeacher.ToString()); }
public void TestConstructor2_True(string nameSubject, string departament) { ResetStandart(); //arrange //act var subject = new Subject.Subject(nameSubject, departament); //assert Assert.AreEqual(nameSubject, subject.NameSubject); Assert.AreEqual(departament, subject.Departament); }
public void TestConstructor_True(string nameSubject, int percent) { ResetStandart(); var subject = new Subject.Subject(nameSubject); //arrange var subjectOfTeacher = new SubjectOfTeacher.SubjectOfTeacher(subject, percent); //act //assert Assert.AreEqual(subject, subjectOfTeacher.Subject); Assert.AreEqual(percent, subjectOfTeacher.Percent); }
public void TestStandartValue() { ResetStandart(); //arrange //act var subject1 = new Subject.Subject(standatrNameSubject); var subject2 = new Subject.Subject(standatrNameSubject, standatrDepartament); //assert Assert.AreEqual(standatrNameSubject, subject1.NameSubject); Assert.AreEqual(null, subject1.Departament); Assert.AreEqual(standatrNameSubject, subject2.NameSubject); Assert.AreEqual(standatrDepartament, subject2.Departament); }
public void TestToString(string groupName, int groupCours, string groupSeminar, TypeStudy groupTypeStudy, string[] nameSubject, int[] numberSubject, string result) { //arrange IGroup group = new Group.Group(groupName, groupCours, groupSeminar, groupTypeStudy); List <INumberOfLesson> numberOfLessons = new List <INumberOfLesson>(); for (int i = 0; i < nameSubject.Length; i++) { ISubject subject = new Subject.Subject(nameSubject[i]); INumberOfLesson numberOfLesson = new NumberOfLesson.NumberOfLesson(subject, numberSubject[i]); numberOfLessons.Add(numberOfLesson); } //act PlanOfLessons.PlanOfLessons planOfLessons = new PlanOfLessons.PlanOfLessons(group, numberOfLessons); //assert Assert.AreEqual(result, planOfLessons.ToString()); }
public void TestConstructor2_Exception(string departament, Type result) { ResetStandart(); Type exception = null; //arrange try { //act var subject = new Subject.Subject(standatrNameSubject, departament); } catch (Exception ex) { //assert exception = ex.GetType(); } finally { Assert.AreEqual(result, exception); } }
public Subject.Subject CreateSubjects(SubjectInformation subjectInfo) { var subject = new Subject.Subject(subjectInfo); return(subject); }
private void timer1_Tick(object sender, EventArgs e) { this.label1.Text = DateTime.Now.ToLongTimeString(); Subject.Subject sub = new Subject.Subject(); sub.Notify(); }
static void Main() { Console.WriteLine("Begin"); //Gender.Gender gender = new Gender.Gender("мужской"); //var genders = new List<Gender.Gender> //{ // new Gender.Gender("мужской"), // new Gender.Gender("женский"), //}; ClassRoom.ClassRoom classRoom = new ClassRoom.ClassRoom("Аудит1", 101); var classRooms = new List <ClassRoom.ClassRoom> { new ClassRoom.ClassRoom("Аудит1", 50), new ClassRoom.ClassRoom("Аудит2", 34), new ClassRoom.ClassRoom("Аудит3", 45), new ClassRoom.ClassRoom("Аудит4", 107), new ClassRoom.ClassRoom("Аудит5", 31), }; Group.Group group = new Group.Group("TBO", 2, "TBO-2", Interface.Interface.TypeStudy.FullTimeEducation, 35); var groups = new List <Group.Group> { new Group.Group("TBO", 1, "TBO-1", Interface.Interface.TypeStudy.FullTimeEducation, 35), new Group.Group("TBO", 2, "TBO-2", Interface.Interface.TypeStudy.FullTimeEducation, 25), new Group.Group("TMO", 3, "TMO-3", Interface.Interface.TypeStudy.FullTimeEducation, 11), new Group.Group("TCO", 2, "TCO-2", Interface.Interface.TypeStudy.FullTimeEducation, 54), }; Subject.Subject subject = new Subject.Subject("Математика"); var subjects = new List <Subject.Subject> { new Subject.Subject("программирование 2 курс"), new Subject.Subject("математический анализ 3 курс"), new Subject.Subject("введение в специальность 1 курс"), new Subject.Subject("история России 1-4 курс"), }; NumberOfLesson.NumberOfLesson numberOfLesson = new NumberOfLesson.NumberOfLesson(subject, 5); var numberOfLessons = new List <NumberOfLesson.NumberOfLesson> [groups.Count]; for (int i = 0; i < groups.Count; i++) { int r1 = i * 5 % subjects.Count; int r2 = i * 3 % subjects.Count; if (r1 == r2) { r1 = (r1 + 1) % subjects.Count; } var tempNumberOfLessons = new List <NumberOfLesson.NumberOfLesson> { new NumberOfLesson.NumberOfLesson(subjects[r1], 7), new NumberOfLesson.NumberOfLesson(subjects[r2], 9), }; numberOfLessons[i] = tempNumberOfLessons; } ; Semester.Semester semester = new Semester.Semester(new DateTime(2019, 02, 02), new DateTime(2019, 05, 31)); DaysOfStudy.DaysOfStudy daysOfStudy = new DaysOfStudy.DaysOfStudy(DateTime.Now, Interface.Interface.HowDays.DayOff); Person.Person person = new Person.Person("Dima", Interface.Interface.Gender.men, new DateTime(1996, 05, 19), "Юго западная"); SubjectOfTeacher.SubjectOfTeacher subjectOfTeacher = new SubjectOfTeacher.SubjectOfTeacher(subject, 10); Teacher.Teacher teacher = new Teacher.Teacher(new List <SubjectOfTeacher.Interfaces.ISubjectOfTeacherWithConsole> { subjectOfTeacher }, "none", 1, person); var teachers = new List <Teacher.Teacher>(); string[] names = { "Александр", "Максим", "Виктор", "Дмитрий", "Олег" }; for (int i = 0; i < 5; i++) { int r1 = i * 5 % subjects.Count; int r2 = i * 3 % subjects.Count; if (r1 == r2) { r1 = (r1 + 1) % subjects.Count; } var subjectOfTeacher1 = new List <SubjectOfTeacher.Interfaces.ISubjectOfTeacherWithConsole> { new SubjectOfTeacher.SubjectOfTeacher(subjects[r1], 100), new SubjectOfTeacher.SubjectOfTeacher(subjects[r2], 100), }; var person1 = new Person.Person(names[i], genders[0], new DateTime(1958 + i, (17 * i) % 12 + 1, (23 * i) % 28 + 1), "Not info"); var teacher1 = new Teacher.Teacher(subjectOfTeacher1, "none", 1, person1); teachers.Add(teacher1); } TimeLessons.TimeLessons timeLessons = new TimeLessons.TimeLessons(new TimeSpan(09, 00, 00), new TimeSpan(10, 30, 00), 1); var timeLessonss = new List <TimeLessons.TimeLessons> { new TimeLessons.TimeLessons(new TimeSpan(09, 00, 00), new TimeSpan(10, 30, 00), 1), new TimeLessons.TimeLessons(new TimeSpan(10, 40, 00), new TimeSpan(12, 10, 00), 2), new TimeLessons.TimeLessons(new TimeSpan(13, 00, 00), new TimeSpan(14, 30, 00), 3), new TimeLessons.TimeLessons(new TimeSpan(14, 40, 00), new TimeSpan(16, 10, 00), 4), new TimeLessons.TimeLessons(new TimeSpan(16, 20, 00), new TimeSpan(17, 50, 00), 5), new TimeLessons.TimeLessons(new TimeSpan(18, 00, 00), new TimeSpan(19, 30, 00), 6), }; TypeLessons.TypeLessons typeLessons = new TypeLessons.TypeLessons("Лекция"); var typeLessonss = new List <TypeLessons.TypeLessons> { new TypeLessons.TypeLessons("Лекция"), new TypeLessons.TypeLessons("Практика"), }; Console.WriteLine("Вы вышли в основную программу!"); Console.ReadLine(); }
public void Save(Subject.Subject entity) { _subject.SaveDates(); }
void Awake() { subject = GetComponent <Subject.Subject>(); subjectsCharacterController = GetComponent <CharacterController>(); }