Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests in StoreGeneratedTestBase #27877

Merged
1 commit merged into from
Apr 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions test/EFCore.Specification.Tests/StoreGeneratedTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,7 @@ public virtual void Insert_update_and_delete_with_wrapped_int_key()
Assert.Null(optionalDependents1.Single(e => e.Principal == null).PrincipalId);

var requiredDependents1 = context.Set<WrappedIntClassDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents1.Count);
Assert.Single(requiredDependents1);

var dependents2 = context.Set<WrappedIntStructDependentShadow>().Include(e => e.Principal).ToList();
Assert.Equal(2, dependents2.Count);
Expand All @@ -2138,7 +2138,7 @@ public virtual void Insert_update_and_delete_with_wrapped_int_key()
Assert.Null(optionalDependents2.Single(e => e.Principal == null).PrincipalId);

var requiredDependents2 = context.Set<WrappedIntStructDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents2.Count);
Assert.Single(requiredDependents2);

var dependents3 = context.Set<WrappedIntRecordDependentShadow>().Include(e => e.Principal).ToList();
Assert.Equal(2, dependents3.Count);
Expand All @@ -2151,7 +2151,7 @@ public virtual void Insert_update_and_delete_with_wrapped_int_key()
Assert.Null(optionalDependents3.Single(e => e.Principal == null).PrincipalId);

var requiredDependents3 = context.Set<WrappedIntRecordDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents3.Count);
Assert.Single(requiredDependents3);

context.Remove(dependents1.Single(e => e.Principal != null));
context.Remove(optionalDependents1.Single(e => e.Principal != null));
Expand Down Expand Up @@ -2650,7 +2650,7 @@ public virtual void Insert_update_and_delete_with_wrapped_string_key()
Assert.Null(optionalDependents1.Single(e => e.Principal == null).PrincipalId);

var requiredDependents1 = context.Set<WrappedStringClassDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents1.Count);
Assert.Single(requiredDependents1);

var dependents2 = context.Set<WrappedStringStructDependentShadow>().Include(e => e.Principal).ToList();
Assert.Equal(2, dependents2.Count);
Expand All @@ -2663,7 +2663,7 @@ public virtual void Insert_update_and_delete_with_wrapped_string_key()
Assert.Null(optionalDependents2.Single(e => e.Principal == null).PrincipalId);

var requiredDependents2 = context.Set<WrappedStringStructDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents2.Count);
Assert.Single(requiredDependents2);

var dependents3 = context.Set<WrappedStringRecordDependentShadow>().Include(e => e.Principal).ToList();
Assert.Equal(2, dependents3.Count);
Expand All @@ -2676,7 +2676,7 @@ public virtual void Insert_update_and_delete_with_wrapped_string_key()
Assert.Null(optionalDependents3.Single(e => e.Principal == null).PrincipalId);

var requiredDependents3 = context.Set<WrappedStringRecordDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents3.Count);
Assert.Single(requiredDependents3);

context.Remove(dependents1.Single(e => e.Principal != null));
context.Remove(optionalDependents1.Single(e => e.Principal != null));
Expand Down Expand Up @@ -3178,7 +3178,7 @@ public virtual void Insert_update_and_delete_with_wrapped_Guid_key()
Assert.Null(optionalDependents1.Single(e => e.Principal == null).PrincipalId);

var requiredDependents1 = context.Set<WrappedGuidClassDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents1.Count);
Assert.Single(requiredDependents1);

var dependents2 = context.Set<WrappedGuidStructDependentShadow>().Include(e => e.Principal).ToList();
Assert.Equal(2, dependents2.Count);
Expand All @@ -3191,7 +3191,7 @@ public virtual void Insert_update_and_delete_with_wrapped_Guid_key()
Assert.Null(optionalDependents2.Single(e => e.Principal == null).PrincipalId);

var requiredDependents2 = context.Set<WrappedGuidStructDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents2.Count);
Assert.Single(requiredDependents2);

var dependents3 = context.Set<WrappedGuidRecordDependentShadow>().Include(e => e.Principal).ToList();
Assert.Equal(2, dependents3.Count);
Expand All @@ -3204,7 +3204,7 @@ public virtual void Insert_update_and_delete_with_wrapped_Guid_key()
Assert.Null(optionalDependents3.Single(e => e.Principal == null).PrincipalId);

var requiredDependents3 = context.Set<WrappedGuidRecordDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents3.Count);
Assert.Single(requiredDependents3);

context.Remove(dependents1.Single(e => e.Principal != null));
context.Remove(optionalDependents1.Single(e => e.Principal != null));
Expand Down Expand Up @@ -3706,7 +3706,7 @@ public virtual void Insert_update_and_delete_with_wrapped_Uri_key()
Assert.Null(optionalDependents1.Single(e => e.Principal == null).PrincipalId);

var requiredDependents1 = context.Set<WrappedUriClassDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents1.Count);
Assert.Single(requiredDependents1);

var dependents2 = context.Set<WrappedUriStructDependentShadow>().Include(e => e.Principal).ToList();
Assert.Equal(2, dependents2.Count);
Expand All @@ -3719,7 +3719,7 @@ public virtual void Insert_update_and_delete_with_wrapped_Uri_key()
Assert.Null(optionalDependents2.Single(e => e.Principal == null).PrincipalId);

var requiredDependents2 = context.Set<WrappedUriStructDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents2.Count);
Assert.Single(requiredDependents2);

var dependents3 = context.Set<WrappedUriRecordDependentShadow>().Include(e => e.Principal).ToList();
Assert.Equal(2, dependents3.Count);
Expand All @@ -3732,7 +3732,7 @@ public virtual void Insert_update_and_delete_with_wrapped_Uri_key()
Assert.Null(optionalDependents3.Single(e => e.Principal == null).PrincipalId);

var requiredDependents3 = context.Set<WrappedUriRecordDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents3.Count);
Assert.Single(requiredDependents3);

context.Remove(dependents1.Single(e => e.Principal != null));
context.Remove(optionalDependents1.Single(e => e.Principal != null));
Expand Down Expand Up @@ -3860,7 +3860,7 @@ public virtual void Insert_update_and_delete_with_Uri_key()
Assert.Null(optionalDependents1.Single(e => e.Principal == null).PrincipalId);

var requiredDependents1 = context.Set<UriDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents1.Count);
Assert.Single(requiredDependents1);

context.Remove(dependents1.Single(e => e.Principal != null));
context.Remove(optionalDependents1.Single(e => e.Principal != null));
Expand Down Expand Up @@ -3943,7 +3943,6 @@ public virtual void Insert_update_and_delete_with_enum_key()
Assert.NotNull(id1);
foreach (var dependent in principal1.Dependents)
{
Assert.NotNull(dependent.Id);
Assert.Same(principal1, dependent.Principal);
Assert.Equal(id1, context.Entry(dependent).Property<KeyEnum?>("PrincipalId").CurrentValue);
}
Expand Down Expand Up @@ -3979,7 +3978,7 @@ public virtual void Insert_update_and_delete_with_enum_key()
Assert.Null(optionalDependents1.Single(e => e.Principal == null).PrincipalId);

var requiredDependents1 = context.Set<EnumDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents1.Count);
Assert.Single(requiredDependents1);

context.Remove(dependents1.Single(e => e.Principal != null));
context.Remove(optionalDependents1.Single(e => e.Principal != null));
Expand Down Expand Up @@ -4053,7 +4052,6 @@ public virtual void Insert_update_and_delete_with_GuidAsString_key()
Assert.NotNull(id1);
foreach (var dependent in principal1.Dependents)
{
Assert.NotNull(dependent.Id);
Assert.Same(principal1, dependent.Principal);
Assert.Equal(id1, context.Entry(dependent).Property<Guid?>("PrincipalId").CurrentValue);
}
Expand Down Expand Up @@ -4089,7 +4087,7 @@ public virtual void Insert_update_and_delete_with_GuidAsString_key()
Assert.Null(optionalDependents1.Single(e => e.Principal == null).PrincipalId);

var requiredDependents1 = context.Set<GuidAsStringDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents1.Count);
Assert.Single(requiredDependents1);

context.Remove(dependents1.Single(e => e.Principal != null));
context.Remove(optionalDependents1.Single(e => e.Principal != null));
Expand Down Expand Up @@ -4199,7 +4197,7 @@ public virtual void Insert_update_and_delete_with_StringAsGuid_key()
Assert.Null(optionalDependents1.Single(e => e.Principal == null).PrincipalId);

var requiredDependents1 = context.Set<StringAsGuidDependentRequired>().Include(e => e.Principal).ToList();
Assert.Equal(1, requiredDependents1.Count);
Assert.Single(requiredDependents1);

context.Remove(dependents1.Single(e => e.Principal != null));
context.Remove(optionalDependents1.Single(e => e.Principal != null));
Expand Down