Exemplo n.º 1
0
        public SessionsRepoTest()
        {
            var dbOptions = DbInMemory.getDbInMemoryOptions(dbName);

            db          = new TCSContext(dbOptions);
            sessionRepo = new SessionRepo(dbOptions);
        }
Exemplo n.º 2
0
        public ClasstourRepoTest()
        {
            var dbOptions = DbInMemory.getDbInMemoryOptions(dbName);

            db            = new TCSContext(dbOptions);
            classTourRepo = new ClassTourRepo(dbOptions);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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));
        }