Skip to content

Commit

Permalink
Add more MusicStore and Identity tests
Browse files Browse the repository at this point in the history
Covering all the queries MusicStore does, and also updating the tests to properly use store-generated values.

Also, added the ModelSnapshots generated by the project templates for 2.1, 2.2, and 3.0, for SQL Server and SQLite. They all diff correctly against the current code showing no differences in the generated schema.

Part of #15662 and #11838

Note that currently the ASP.NET 3.0 templates still contain migrations generated by 2.2. See dotnet/aspnetcore#12168
  • Loading branch information
ajcvickers committed Jul 15, 2019
1 parent 04eb9ef commit dbf76eb
Show file tree
Hide file tree
Showing 12 changed files with 2,112 additions and 91 deletions.
20 changes: 20 additions & 0 deletions test/EFCore.Relational.Specification.Tests/MigrationsTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,26 @@ protected virtual Task ExecuteAsync(IServiceProvider services, Action<MigrationB
[ConditionalFact]
public abstract void Can_diff_against_2_2_model();

[ConditionalFact]
public abstract void Can_diff_against_3_0_ASP_NET_Identity_model();

[ConditionalFact]
public abstract void Can_diff_against_2_2_ASP_NET_Identity_model();

[ConditionalFact]
public abstract void Can_diff_against_2_1_ASP_NET_Identity_model();

protected virtual void DiffSnapshot(ModelSnapshot snapshot, DbContext context)
{
var sourceModel = snapshot.Model;
var targetModel = context.Model;

var modelDiffer = context.GetService<IMigrationsModelDiffer>();
var operations = modelDiffer.GetDifferences(sourceModel, targetModel);

Assert.Equal(0, operations.Count);
}

protected virtual void BuildFirstMigration(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
Expand Down
Loading

0 comments on commit dbf76eb

Please sign in to comment.