示例#1
0
        public static void DbMigrationTest_ClassInitialize(TestContext context)
        {
            ServerTestHelper.ClassInitialize(context);

            //运行测试前,这个库升级到最新的内容,同时它的历史记录需要清空
            using (var c = new RafyDbMigrationContext(UnitTestEntityRepositoryDataProvider.DbSettingName))
            {
                c.RunDataLossOperation = DataLossOperation.All;

                if (IsTestDbSQLite())
                {
                    c.DeleteAllTables();
                }
                else
                {
                    c.HistoryRepository = new DbHistoryRepository();
                }

                c.AutoMigrate();

                c.ResetDbVersion();

                if (!IsTestDbSQLite())
                {
                    c.ResetHistory();
                }

                var dbProvider = DbMigrationProviderFactory.GetProvider(c.DbSetting);
                dbTypeConverter = (dbProvider.CreateRunGenerator() as SqlRunGenerator).DbTypeCoverter;
            };
        }
示例#2
0
        public static void DbMigrationTest_ClassInitialize(TestContext context)
        {
            ServerTestHelper.ClassInitialize(context);

            //运行测试前,这个库升级到最新的内容,同时它的历史记录需要清空
            using (var c = new RafyDbMigrationContext(UnitTestEntityRepositoryDataProvider.DbSettingName))
            {
                c.HistoryRepository    = new DbHistoryRepository();
                c.RunDataLossOperation = DataLossOperation.All;
                //c.DeleteDatabase();

                c.AutoMigrate();

                c.ResetDbVersion();
                c.ResetHistory();
            };
        }
示例#3
0
文件: DomainTest.cs 项目: yungtau/oea
 public static void DT_ClassInitialize(TestContext context)
 {
     ServerTestHelper.ClassInitialize(context);
 }
示例#4
0
        public static void APT_ClassInitialize(TestContext context)
        {
            ServerTestHelper.ClassInitialize(context);

            RafyEnvironment.LoadPlugin(typeof(UserRepository).Assembly);
        }
示例#5
0
        public static void SNPT_ClassInitialize(TestContext context)
        {
            ServerTestHelper.ClassInitialize(context);

            RafyEnvironment.LoadPlugin(typeof(SerialNumberPlugin).Assembly);
        }
示例#6
0
        public static void SSPT_ClassInitialize(TestContext context)
        {
            ServerTestHelper.ClassInitialize(context);

            RafyEnvironment.LoadPlugin(typeof(SystemSettingsPlugin).Assembly);
        }
示例#7
0
        public static void FSPT_ClassInitialize(TestContext context)
        {
            ServerTestHelper.ClassInitialize(context);

            RafyEnvironment.LoadPlugin(typeof(FileStorageEntity).Assembly);
        }