Created
February 1, 2011 05:05
-
-
Save dcrosby42/805445 to your computer and use it in GitHub Desktop.
Sample code for a migration test using C# and MigratorDotNet for an ASP.NET MVC 2 web app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UnitTests | |
{ | |
public class FullMigrationTest | |
{ | |
public static string[] AllExpectedTables = new[] | |
{ | |
"BlogPost", | |
"Attachment", | |
"Photo", | |
// aspnet auth stuff: | |
"aspnet_Applications", | |
"aspnet_Membership", | |
"aspnet_Profile", | |
"aspnet_Roles", | |
"aspnet_SchemaVersions", | |
"aspnet_Users", | |
"aspnet_UsersInRoles", | |
"SchemaInfo", | |
}; | |
[Test] | |
public void all_migrations_should_run_successfully() | |
{ | |
MigrationTestHelper.MigrateAllTheWayDown(); | |
MigrationTestHelper.MigrateAllTheWayUp(); | |
var tablesInDatabase = GetTablesInDatabase(); | |
Want(tablesInDatabase).ToHaveSameItemsAs(AllExpectedTables); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment