本文整理汇总了C#中Migrator.IsUpToDate方法的典型用法代码示例。如果您正苦于以下问题:C# Migrator.IsUpToDate方法的具体用法?C# Migrator.IsUpToDate怎么用?C# Migrator.IsUpToDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Migrator
的用法示例。
在下文中一共展示了Migrator.IsUpToDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestMigration1SucceededByAllOtherMigrations
public void TestMigration1SucceededByAllOtherMigrations()
{
// execute Migration1
var migrator = new Migrator(ConnectionString, ProviderName, _options);
Assembly assemblyContainingMigrations = typeof(Migration1).Assembly;
migrator.MigrateTo(assemblyContainingMigrations, Timestamps[0]);
// execute all other migrations
migrator = new Migrator(ConnectionString, ProviderName, _options);
migrator.MigrateAll(assemblyContainingMigrations);
Assert.IsTrue(migrator.IsUpToDate(assemblyContainingMigrations));
VerifyResultsOfAllMigrations();
}
示例2: TestIsUpToDate
public void TestIsUpToDate()
{
_options.VersioningTableName = "My Versioning Table"; // test overriding the default versioning table name
var migrator = new Migrator(ConnectionString, ProviderName, _options);
Assert.IsFalse(migrator.IsUpToDate(typeof(Migration1).Assembly));
DataTable versioningTable = GetTable(_options.VersioningTableName);
Assert.IsNull(versioningTable, "Migrator.IsUpToDate should not have any side-effects. In particualar, it should *not* create a versioning table. This allows for being able to check the up-to-dateness of a db without having the privilege to create tables.");
}