private ServiceLocator() { var context = new SchoolMemoryContext(); ISchoolTerminal app = new SchoolTerminal( new StudentsRepository(), new TeachersRepository(), new GradesRepository(), new LessonClassesRepository()); Terminal = app; }
public void Test() { var teacherRepoMock = new Mock <ITeachersRepository>(); var studentsRepoMock = new Mock <IStudentsRepository>(); var gradesRepoMock = new Mock <IGradesRepository>(); var lessonsRepoMock = new Mock <ILessonClassesRepository>(); var terminal = new SchoolTerminal( studentsRepoMock.Object, teacherRepoMock.Object, gradesRepoMock.Object, lessonsRepoMock.Object); terminal.PrintInfo(); teacherRepoMock.Verify(m => m.Get(), Times.Exactly(1)); studentsRepoMock.Verify(m => m.Get(), Times.Exactly(1)); gradesRepoMock.Verify(m => m.Get(), Times.Exactly(1)); lessonsRepoMock.Verify(m => m.Get(), Times.Exactly(1)); }