示例#1
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();
            };
        }