Esempio n. 1
0
 public override void SetUp()
 {
     base.SetUp();
     DeleteBase("t-school.ndb");
     var odb = Open("t-school.ndb");
     var query = odb.Query<Student>();
     var students = query.Execute<Student>(true);
     var numStudents = students.Count;
     var computerScience = new Course("Computer Science");
     var teacher = new Teacher("Jeremias", "Java");
     var dw1 = new Discipline("Des. Web 1", 3);
     var @is = new Discipline("Intranet/Segurança", 4);
     var std1 = new Student(20, computerScience, new DateTime(), "1cs", "Brenna");
     var h1 = new History(new DateTime(), dw1, 0, teacher);
     var h2 = new History(new DateTime(), @is, 0, teacher);
     std1.AddHistory(h1);
     std1.AddHistory(h2);
     odb.Store(std1);
     odb.Commit();
     odb.Close();
     odb = Open("t-school.ndb");
     var query1 = odb.Query<Student>();
     students = query1.Execute<Student>(true);
     odb.Close();
     AssertEquals(numStudents + 1, students.Count);
 }
Esempio n. 2
0
 public Student(int age, Course course, DateTime date, string id, string name)
 {
     this.age = age;
     this.course = course;
     firstDate = date;
     this.id = id;
     this.name = name;
     listHistory = new ArrayList();
 }
Esempio n. 3
0
 public virtual void SetCourse(Course course)
 {
     this.course = course;
 }