예제 #1
0
 public void getTeacherFromDbByName()
 {
     string name = "Fornavn";
     Teacher searchedTeacher;
     using (var tc = new TeacherContext())
     {
         searchedTeacher = tc.GetTeacher(name);
     }
     Assert.IsNotNull(searchedTeacher);
 }
예제 #2
0
 public void getTeacherFromDb()
 {
     int id = 1;
     Teacher searchedTeacher;
     using (var tc = new TeacherContext())
     {
         searchedTeacher = tc.GetTeacher(id);
     }
     Assert.IsNotNull(searchedTeacher.Id);
 }
예제 #3
0
 public void getTeacherFromDbAndEditIt()
 {
     int id = 1;
     bool didWeEdit = false;
     Teacher searchedTeacher;
     using (var tc = new TeacherContext())
     {
         searchedTeacher = tc.GetTeacher(id);
         searchedTeacher.FirstName = "New Name";
         didWeEdit = tc.EditTeacher(searchedTeacher);
     }
     Assert.IsTrue(didWeEdit);
 }