React to EF changes in tests.
This commit is contained in:
parent
88d977b193
commit
4139f3f18b
|
|
@ -14,6 +14,7 @@ using Microsoft.AspNet.Http;
|
||||||
using Microsoft.AspNet.TestHost;
|
using Microsoft.AspNet.TestHost;
|
||||||
using Microsoft.Data.Entity;
|
using Microsoft.Data.Entity;
|
||||||
using Microsoft.Data.Entity.Infrastructure;
|
using Microsoft.Data.Entity.Infrastructure;
|
||||||
|
using Microsoft.Data.Entity.Internal;
|
||||||
using Microsoft.Data.Entity.Relational.Migrations;
|
using Microsoft.Data.Entity.Relational.Migrations;
|
||||||
using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
|
using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
|
||||||
using Microsoft.Data.Entity.Utilities;
|
using Microsoft.Data.Entity.Utilities;
|
||||||
|
|
@ -160,8 +161,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
{
|
{
|
||||||
using (var db = context.ApplicationServices.GetService<BloggingContextWithPendingModelChanges>())
|
using (var db = context.ApplicationServices.GetService<BloggingContextWithPendingModelChanges>())
|
||||||
{
|
{
|
||||||
var databaseInternals = (IMigrationsEnabledDatabaseInternals)db.Database;
|
var migrator = ((IAccessor<Migrator>)db.Database).Service;
|
||||||
var migrator = databaseInternals.Migrator;
|
|
||||||
migrator.ApplyMigrations();
|
migrator.ApplyMigrations();
|
||||||
|
|
||||||
db.Blogs.Add(new Blog());
|
db.Blogs.Add(new Blog());
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ using Microsoft.AspNet.Http;
|
||||||
using Microsoft.AspNet.TestHost;
|
using Microsoft.AspNet.TestHost;
|
||||||
using Microsoft.Data.Entity;
|
using Microsoft.Data.Entity;
|
||||||
using Microsoft.Data.Entity.Infrastructure;
|
using Microsoft.Data.Entity.Infrastructure;
|
||||||
|
using Microsoft.Data.Entity.Internal;
|
||||||
using Microsoft.Data.Entity.Relational.Migrations;
|
using Microsoft.Data.Entity.Relational.Migrations;
|
||||||
using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
|
using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
|
||||||
using Microsoft.Data.Entity.Relational.Migrations.Utilities;
|
using Microsoft.Data.Entity.Relational.Migrations.Utilities;
|
||||||
|
|
@ -104,8 +105,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
|
|
||||||
Assert.True(db.Database.AsRelational().Exists());
|
Assert.True(db.Database.AsRelational().Exists());
|
||||||
|
|
||||||
var databaseInternals = (IMigrationsEnabledDatabaseInternals)db.Database;
|
var migrator = ((IAccessor<Migrator>)db.Database).Service;
|
||||||
var migrator = databaseInternals.Migrator;
|
|
||||||
var appliedMigrations = migrator.GetDatabaseMigrations();
|
var appliedMigrations = migrator.GetDatabaseMigrations();
|
||||||
Assert.Equal(2, appliedMigrations.Count);
|
Assert.Equal(2, appliedMigrations.Count);
|
||||||
Assert.Equal("111111111111111_MigrationOne", appliedMigrations.ElementAt(0).GetMigrationId());
|
Assert.Equal("111111111111111_MigrationOne", appliedMigrations.ElementAt(0).GetMigrationId());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue