示例#1
0
        protected ApertureTester()
        {
            var dbContextOptions = new DbContextOptionsBuilder <ApertureContext>()
                                   .EnableSensitiveDataLogging()
                                   .UseSqlServer("Server=(localdb)\\CaveTester;Database=tests;Trusted_Connection=True;MultipleActiveResultSets=true");

            Context = new ApertureContext(dbContextOptions.Options);

            //Save the database
            //The database will automatically be restored from this save when the test end
            SaveHandler.Add(new SqlServerDbSnapshot(Context.Database));

            //Set which rule set to use when generating objects
            RuleSetHandler.RuleSet = new ApertureRuleSet();
        }