-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converting Inheritance relationship tests to AssertQuery infra
- Loading branch information
Showing
31 changed files
with
2,036 additions
and
1,261 deletions.
There are no files selected for viewing
324 changes: 172 additions & 152 deletions
324
...e.Relational.Specification.Tests/Query/InheritanceRelationshipsQueryRelationalTestBase.cs
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
test/EFCore.Relational.Specification.Tests/Query/TPTRelationshipsQueryRelationalFixture.cs
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
554 changes: 552 additions & 2 deletions
554
test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryFixtureBase.cs
Large diffs are not rendered by default.
Oops, something went wrong.
706 changes: 378 additions & 328 deletions
706
test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryTestBase.cs
Large diffs are not rendered by default.
Oops, something went wrong.
500 changes: 0 additions & 500 deletions
500
...pecification.Tests/TestModels/InheritanceRelationships/InheritanceRelationshipsContext.cs
This file was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
...eRelationships/BaseCollectionOnDerived.cs → ...tionshipsModel/BaseCollectionOnDerived.cs
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
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
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
2 changes: 1 addition & 1 deletion
2
...ceRelationships/BaseReferenceOnDerived.cs → ...ationshipsModel/BaseReferenceOnDerived.cs
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
2 changes: 1 addition & 1 deletion
2
...eritanceRelationships/CollectionOnBase.cs → ...nceRelationshipsModel/CollectionOnBase.cs
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
2 changes: 1 addition & 1 deletion
2
...tanceRelationships/CollectionOnDerived.cs → ...RelationshipsModel/CollectionOnDerived.cs
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
2 changes: 1 addition & 1 deletion
2
...eRelationships/DerivedCollectionOnBase.cs → ...tionshipsModel/DerivedCollectionOnBase.cs
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
2 changes: 1 addition & 1 deletion
2
...lationships/DerivedCollectionOnDerived.cs → ...nshipsModel/DerivedCollectionOnDerived.cs
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
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
2 changes: 1 addition & 1 deletion
2
...ceRelationships/DerivedReferenceOnBase.cs → ...ationshipsModel/DerivedReferenceOnBase.cs
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
2 changes: 1 addition & 1 deletion
2
...elationships/DerivedReferenceOnDerived.cs → ...onshipsModel/DerivedReferenceOnDerived.cs
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
77 changes: 77 additions & 0 deletions
77
...ication.Tests/TestModels/InheritanceRelationshipsModel/InheritanceRelationshipsContext.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using Microsoft.EntityFrameworkCore.TestUtilities; | ||
|
||
namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel | ||
{ | ||
public class InheritanceRelationshipsContext : PoolableDbContext | ||
{ | ||
public static readonly string StoreName = "InheritanceRelationships"; | ||
|
||
public InheritanceRelationshipsContext(DbContextOptions options) | ||
: base(options) | ||
{ | ||
} | ||
|
||
public DbSet<BaseCollectionOnBase> BaseCollectionsOnBase { get; set; } | ||
public DbSet<BaseCollectionOnDerived> BaseCollectionsOnDerived { get; set; } | ||
public DbSet<BaseInheritanceRelationshipEntity> BaseEntities { get; set; } | ||
public DbSet<BaseReferenceOnBase> BaseReferencesOnBase { get; set; } | ||
public DbSet<BaseReferenceOnDerived> BaseReferencesOnDerived { get; set; } | ||
public DbSet<CollectionOnBase> CollectionsOnBase { get; set; } | ||
public DbSet<CollectionOnDerived> CollectionsOnDerived { get; set; } | ||
public DbSet<NestedCollectionBase> NestedCollections { get; set; } | ||
public DbSet<NestedReferenceBase> NestedReferences { get; set; } | ||
public DbSet<PrincipalEntity> PrincipalEntities { get; set; } | ||
public DbSet<ReferencedEntity> ReferencedEntities { get; set; } | ||
public DbSet<ReferenceOnBase> ReferencesOnBase { get; set; } | ||
public DbSet<ReferenceOnDerived> ReferencesOnDerived { get; set; } | ||
|
||
public static void Seed(InheritanceRelationshipsContext context) | ||
{ | ||
var baseCollectionsOnBase = InheritanceRelationshipsData.CreateBaseCollectionsOnBase(); | ||
var baseCollectionsOnDerived = InheritanceRelationshipsData.CreateBaseCollectionsOnDerived(); | ||
var baseEntities = InheritanceRelationshipsData.CreateBaseEntities(); | ||
var baseReferencesOnBase = InheritanceRelationshipsData.CreateBaseReferencesOnBase(); | ||
var baseReferencesOnDerived = InheritanceRelationshipsData.CreateBaseReferencesOnDerived(); | ||
var collectionsOnBase = InheritanceRelationshipsData.CreateCollectionsOnBase(); | ||
var collectionsOnDerived = InheritanceRelationshipsData.CreateCollectionsOnDerived(); | ||
var nestedCollections = InheritanceRelationshipsData.CreateNestedCollections(); | ||
var nestedReferences = InheritanceRelationshipsData.CreateNestedReferences(); | ||
var principalEntities = InheritanceRelationshipsData.CreatePrincipalEntities(); | ||
var referencedEntities = InheritanceRelationshipsData.CreateReferencedEntities(); | ||
var referencesOnBase = InheritanceRelationshipsData.CreateReferencesOnBase(); | ||
var referencesOnDerived = InheritanceRelationshipsData.CreateReferencesOnDerived(); | ||
|
||
InheritanceRelationshipsData.WireUp( | ||
baseEntities, | ||
baseReferencesOnBase, | ||
baseReferencesOnDerived, | ||
referencesOnBase, | ||
referencesOnDerived, | ||
nestedReferences, | ||
baseCollectionsOnBase, | ||
baseCollectionsOnDerived, | ||
collectionsOnBase, | ||
collectionsOnDerived, | ||
nestedCollections); | ||
|
||
context.BaseCollectionsOnBase.AddRange(baseCollectionsOnBase); | ||
context.BaseCollectionsOnDerived.AddRange(baseCollectionsOnDerived); | ||
context.BaseEntities.AddRange(baseEntities); | ||
context.BaseReferencesOnBase.AddRange(baseReferencesOnBase); | ||
context.BaseReferencesOnDerived.AddRange(baseReferencesOnDerived); | ||
context.CollectionsOnBase.AddRange(collectionsOnBase); | ||
context.CollectionsOnDerived.AddRange(collectionsOnDerived); | ||
context.NestedCollections.AddRange(nestedCollections); | ||
context.NestedReferences.AddRange(nestedReferences); | ||
context.PrincipalEntities.AddRange(principalEntities); | ||
context.ReferencedEntities.AddRange(referencedEntities); | ||
context.ReferencesOnBase.AddRange(referencesOnBase); | ||
context.ReferencesOnDerived.AddRange(referencesOnDerived); | ||
|
||
context.SaveChanges(); | ||
} | ||
} | ||
} |
Oops, something went wrong.