public SessionsRepoTest() { var dbOptions = DbInMemory.getDbInMemoryOptions(dbName); db = new TCSContext(dbOptions); sessionRepo = new SessionRepo(dbOptions); }
public ClasstourRepoTest() { var dbOptions = DbInMemory.getDbInMemoryOptions(dbName); db = new TCSContext(dbOptions); classTourRepo = new ClassTourRepo(dbOptions); }
public UnitOfWorkSessionTest() { var dbInMemory = DbInMemory.getDbInMemoryOptions(dbName); var personRepo = new PersonRepo(dbInMemory); var sessionRepo = new SessionRepo(dbInMemory); var reasonRepo = new ReasonRepo(dbInMemory); var classRepo = new ClassRepo(dbInMemory); var semesterRepo = new SemesterRepo(dbInMemory); db = new TCSContext(dbInMemory); unitSession = new UnitOfWorkSession(personRepo, reasonRepo, sessionRepo, classRepo, semesterRepo); }
public UserRepoTest() { var dbOptions = DbInMemory.getDbInMemoryOptions(dbName); db = new TCSContext(dbOptions); userRepo = new UserRepo(dbOptions); fixture = new Fixture() .Customize(new AutoMoqCustomization()); // Sets all users created by autofixture to not have properties set fixture.Customize <User> ((ob) => ob.Without(x => x.Id).Without(x => x.PasswordHash).Without(x => x.PasswordSalt)); }
public UnitOfWorkPersonTest() { var dbInMemory = DbInMemory.getDbInMemoryOptions(dbName); var personRepo = new PersonRepo(dbInMemory); var classRepo = new ClassRepo(dbInMemory); var scheduleRepo = new ScheduleRepo(dbInMemory); var semesterRepo = new SemesterRepo(dbInMemory); var departmentRepo = new DepartmentRepo(dbInMemory); db = new TCSContext(dbInMemory); mockBannerService = new Mock <IBannerService>(); unitPerson = new UnitOfWorkPerson(personRepo, scheduleRepo, classRepo, semesterRepo, departmentRepo, mockBannerService.Object); }
public SessionsControllerTest() { var dbOptions = DbInMemory.getDbInMemoryOptions(dbName); db = new TCSContext(dbOptions); sessionRepo = new SessionRepo(dbOptions); var personRepo = new PersonRepo(dbOptions); var semesterRepo = new SemesterRepo(dbOptions); var sessionClassRepo = new SessionClassRepo(dbOptions); var sessionReasonRepo = new SessionReasonRepo(dbOptions); var mapper = Helpers.Utils.GetProjectMapper(); sessionController = new SessionsController(sessionRepo, semesterRepo, personRepo, sessionReasonRepo, sessionClassRepo, mapper); }
public SessionsControllerTest() { var dbOptions = DbInMemory.getDbInMemoryOptions(dbName); db = new TCSContext(dbOptions); sessionRepo = new SessionRepo(dbOptions); var personRepo = new PersonRepo(dbOptions); var semesterRepo = new SemesterRepo(dbOptions); var sessionClassRepo = new SessionClassRepo(dbOptions); var sessionReasonRepo = new SessionReasonRepo(dbOptions); var reasonRepo = new ReasonRepo(dbOptions); var classRepo = new ClassRepo(dbOptions); csvParser = new CSVSessionUploadParser(); var mapper = Utils.GetProjectMapper(); var unitSession = new UnitOfWorkSession(personRepo, reasonRepo, sessionRepo, classRepo, semesterRepo); sessionController = new SessionsController(sessionRepo, semesterRepo, personRepo, sessionReasonRepo, sessionClassRepo, mapper, csvParser, unitSession); }
public UserRepoTest() { AppSettings appSettings = new AppSettings() { Secret = secret }; mockAppSettings = new Mock <IOptions <AppSettings> >(); mockAppSettings.Setup(ap => ap.Value).Returns(appSettings); var dbOptions = DbInMemory.getDbInMemoryOptions(dbName); db = new TCSContext(dbOptions); userRepo = new UserRepo(dbOptions, mockAppSettings.Object); fixture = new Fixture() .Customize(new AutoMoqCustomization()); // Sets all users created by autofixture to not have properties set fixture.Customize <User>((ob) => ob.Without(x => x.Id).Without(x => x.PasswordHash).Without(x => x.PasswordSalt)); }