public async Task No_database_or_migrations_only_displays_scaffold_first_migration() { var options = new DatabaseErrorPageOptions(); var model = new DatabaseErrorPageModel( contextType: typeof(BloggingContext), exception: new Exception(), databaseExists: false, pendingModelChanges: false, pendingMigrations: new string[] { }, options: options); var content = await ExecutePage(options, model); AssertHelpers.DisplaysScaffoldFirstMigration(typeof(BloggingContext), content); AssertHelpers.NotDisplaysApplyMigrations(typeof(BloggingContext), content); AssertHelpers.NotDisplaysScaffoldNextMigraion(typeof(BloggingContext), content); }
public async Task Pending_model_changes_only_displays_scaffold_next_migration() { var options = new DatabaseErrorPageOptions(); options.SetDefaultVisibility(true); var model = new DatabaseErrorPageModel( contextType: typeof(BloggingContext), exception: new Exception(), databaseExists: true, pendingModelChanges: true, pendingMigrations: new string[] { }, options: options); var content = await ExecutePage(options, model); AssertHelpers.NotDisplaysScaffoldFirstMigration(typeof(BloggingContext), content); AssertHelpers.NotDisplaysApplyMigrations(typeof(BloggingContext), content); AssertHelpers.DisplaysScaffoldNextMigraion(typeof(BloggingContext), content); }
public async Task Pending_model_changes_only_displays_scaffold_next_migration() { var options = new DatabaseErrorPageOptions(); var model = new DatabaseErrorPageModel( new Exception(), new DatabaseContextDetails[] { new DatabaseContextDetails( type: typeof(BloggingContext), databaseExists: true, pendingModelChanges: true, pendingMigrations: new string[] { }) }, options: options, pathBase: PathString.Empty); var content = await ExecutePage(options, model); AssertHelpers.NotDisplaysScaffoldFirstMigration(typeof(BloggingContext), content); AssertHelpers.NotDisplaysApplyMigrations(typeof(BloggingContext), content); AssertHelpers.DisplaysScaffoldNextMigraion(typeof(BloggingContext), content); }