Beispiel #1
0
 public void Setup()
 {
     _contextFactory = new SampleDbContextFactory();
     using ApplicationContext context = _contextFactory.CreateDbContext();
     context.Lecturers.Add(new Lecturer {
         FullName = "Test Lecturer"
     });
     context.SaveChanges();
 }
Beispiel #2
0
        public void Setup()
        {
            _contextFactory = new SampleDbContextFactory();

            using var context = _contextFactory.CreateDbContext();
            context.Lecturers.Add(new Lecturer {
                FullName = "Test Lecturer"
            });
            context.SaveChanges();

            context.Courses.Add(new Course {
                Name = "Test Course", LecturerId = 1
            });
            context.SaveChanges();

            context.Lectures.Add(new Lecture {
                Name = "Test Lecture 1", CourseId = 1
            });
            context.Lectures.Add(new Lecture {
                Name = "Test Lecture 2", CourseId = 1
            });
            context.Lectures.Add(new Lecture {
                Name = "Test Lecture 3", CourseId = 1
            });
            context.Lectures.Add(new Lecture {
                Name = "Test Lecture 4", CourseId = 1
            });
            context.Lectures.Add(new Lecture {
                Name = "Test Lecture 5", CourseId = 1
            });
            context.SaveChanges();

            context.Students.Add(new Student {
                FullName = "Test Student"
            });
            context.SaveChanges();
        }
Beispiel #3
0
 public void Setup()
 {
     _contextFactory = new SampleDbContextFactory();
 }