Exemplo n.º 1
0
 public static void CreateSchema(IEngineContext context)
 {
     AR.CreateSchema();
     AR.ConfigurationSource.GetAllConfigurationKeys().ForAll(key => {
         var config = AR.ConfigurationSource.GetConfiguration(key);
         config.Assemblies.ForAll(a => {
             var initializers = a.GetTypes().Where(t => !t.IsInterface && typeof(IDefaultFixtureProvider).IsAssignableFrom(t));
             initializers.ForAll(i => {
                 var initializer = Activator.CreateInstance(i) as IDefaultFixtureProvider;
                 if (initializer == null)
                 {
                     return;
                 }
                 using (var transaction = new TransactionScope()) {
                     try {
                         initializer.CreateDefaultFixture();
                         transaction.VoteCommit();
                     }
                     catch {
                         transaction.VoteRollBack();
                         throw;
                     }
                 }
             });
         });
     });
 }
Exemplo n.º 2
0
        /// <summary>
        /// The common test setup code. To activate it in a specific test framework,
        /// it must be called from a framework-specific setup-Method.
        /// </summary>
        public virtual void SetUp()
        {
            AR.ResetInitialization();

            GetConfigSource().Initialize();

            AR.CreateSchema();
        }