Skip to content
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
44 changes: 22 additions & 22 deletions test/EFCore.Specification.Tests/ApiConsistencyTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void Exceptions_are_valid()
}

[ConditionalFact]
public void Fluent_api_methods_should_not_return_void()
public virtual void Fluent_api_methods_should_not_return_void()
{
var voidMethods
= (from type in GetAllTypes(Fixture.FluentApiTypes)
Expand All @@ -65,7 +65,7 @@ from method in type.GetMethods(PublicInstance | BindingFlags.Static | BindingFla
}

[ConditionalFact]
public void Generic_fluent_api_methods_should_return_generic_types()
public virtual void Generic_fluent_api_methods_should_return_generic_types()
{
var nonGenericMethods = new List<(Type Type, MethodInfo Method)>();
foreach (var type in GetAllTypes(Fixture.FluentApiTypes))
Expand Down Expand Up @@ -208,7 +208,7 @@ protected Type GetEquivalentGenericType(Type parameterType, Type[] hidingGeneric
}

[ConditionalFact]
public void Builders_have_matching_methods()
public virtual void Builders_have_matching_methods()
{
foreach (var tuple in Fixture.MirrorTypes)
{
Expand Down Expand Up @@ -260,7 +260,7 @@ public void Builders_have_matching_methods()
}

[ConditionalFact]
public void Metadata_types_have_expected_structure()
public virtual void Metadata_types_have_expected_structure()
{
var errors = Fixture.MetadataTypes.Select(ValidateMetadata)
.Where(e => e != null)
Expand All @@ -274,7 +274,7 @@ public void Metadata_types_have_expected_structure()
private static readonly string MetadataNamespace = typeof(IReadOnlyModel).Namespace;
private static readonly string MetadataBuilderNamespace = typeof(IConventionModelBuilder).Namespace;

private string ValidateMetadata(KeyValuePair<Type, (Type, Type, Type, Type)> types)
protected virtual string ValidateMetadata(KeyValuePair<Type, (Type, Type, Type, Type)> types)
{
var readOnlyType = types.Key;
var (mutableType, conventionType, conventionBuilderType, runtimeType) = types.Value;
Expand Down Expand Up @@ -369,7 +369,7 @@ private string ValidateMetadata(KeyValuePair<Type, (Type, Type, Type, Type)> typ
}

[ConditionalFact]
public void Mutable_metadata_types_have_matching_methods()
public virtual void Mutable_metadata_types_have_matching_methods()
{
var errors =
Fixture.MetadataMethods.Select(
Expand All @@ -390,7 +390,7 @@ from mutableMethod in mutableGroup.DefaultIfEmpty()
"\r\n-- Mismatches: --\r\n" + string.Join(Environment.NewLine, errors));
}

private string MatchMutable((MethodInfo Readonly, MethodInfo Mutable) methodTuple)
protected virtual string MatchMutable((MethodInfo Readonly, MethodInfo Mutable) methodTuple)
{
var (readonlyMethod, mutableMethod) = methodTuple;

Expand Down Expand Up @@ -432,7 +432,7 @@ private string MatchMutable((MethodInfo Readonly, MethodInfo Mutable) methodTupl
}

[ConditionalFact]
public void Convention_metadata_types_have_matching_methods()
public virtual void Convention_metadata_types_have_matching_methods()
{
var errors =
Fixture.MetadataMethods.Select(
Expand Down Expand Up @@ -463,7 +463,7 @@ static string GetConventionName(MethodInfo mutableMethod)
}
}

private string MatchConvention((MethodInfo Mutable, MethodInfo Convention) methodTuple)
protected virtual string MatchConvention((MethodInfo Mutable, MethodInfo Convention) methodTuple)
{
var (mutableMethod, conventionMethod) = methodTuple;

Expand Down Expand Up @@ -514,7 +514,7 @@ private string MatchConvention((MethodInfo Mutable, MethodInfo Convention) metho
}

[ConditionalFact]
public void Convention_metadata_types_have_expected_methods()
public virtual void Convention_metadata_types_have_expected_methods()
{
var errors =
Fixture.MetadataMethods.Select(t => ValidateConventionMethods(t.Convention))
Expand All @@ -526,7 +526,7 @@ public void Convention_metadata_types_have_expected_methods()
"\r\n-- Errors: --\r\n" + string.Join(Environment.NewLine, errors));
}

private string ValidateConventionMethods(IReadOnlyList<MethodInfo> methods)
protected virtual string ValidateConventionMethods(IReadOnlyList<MethodInfo> methods)
{
if (methods.Count == 0)
{
Expand Down Expand Up @@ -563,7 +563,7 @@ private string ValidateConventionMethods(IReadOnlyList<MethodInfo> methods)
}

[ConditionalFact]
public void Convention_builder_types_have_expected_methods()
public virtual void Convention_builder_types_have_expected_methods()
{
var errors =
Fixture.MetadataMethods.Select(t => ValidateConventionBuilderMethods(t.ConventionBuilder))
Expand All @@ -575,7 +575,7 @@ public void Convention_builder_types_have_expected_methods()
"\r\n-- Errors: --\r\n" + string.Join(Environment.NewLine, errors));
}

private string ValidateConventionBuilderMethods(IReadOnlyList<MethodInfo> methods)
protected virtual string ValidateConventionBuilderMethods(IReadOnlyList<MethodInfo> methods)
{
if (methods == null
|| methods.Count == 0)
Expand Down Expand Up @@ -668,7 +668,7 @@ private string ValidateConventionBuilderMethods(IReadOnlyList<MethodInfo> method
}

[ConditionalFact]
public void Convention_builder_methods_have_matching_returns()
public virtual void Convention_builder_methods_have_matching_returns()
{
var errors =
Fixture.MetadataTypes.Select(
Expand All @@ -683,7 +683,7 @@ public void Convention_builder_methods_have_matching_returns()
+ string.Join(Environment.NewLine, errors));
}

private string ValidateConventionBuilderMethodReturns(Type builderType, Type conventionType)
protected virtual string ValidateConventionBuilderMethodReturns(Type builderType, Type conventionType)
{
if (builderType == null)
{
Expand Down Expand Up @@ -818,7 +818,7 @@ private string ValidateConventionBuilderMethodReturns(Type builderType, Type con
}

[ConditionalFact]
public void Runtime_metadata_types_have_matching_methods()
public virtual void Runtime_metadata_types_have_matching_methods()
{
var errors =
Fixture.MetadataMethods.Select(
Expand All @@ -838,7 +838,7 @@ from runtimeMethod in runtimeGroup.DefaultIfEmpty()
"\r\n-- Mismatches: --\r\n" + string.Join(Environment.NewLine, errors));
}

private string MatchRuntime((MethodInfo ReadOnly, MethodInfo Runtime) methodTuple)
protected virtual string MatchRuntime((MethodInfo ReadOnly, MethodInfo Runtime) methodTuple)
{
var (readOnlyMethod, runtimeMethod) = methodTuple;

Expand Down Expand Up @@ -889,7 +889,7 @@ private string MatchRuntime((MethodInfo ReadOnly, MethodInfo Runtime) methodTupl
}

[ConditionalFact]
public void Readonly_metadata_methods_have_expected_name()
public virtual void Readonly_metadata_methods_have_expected_name()
{
var errors =
Fixture.MetadataMethods
Expand Down Expand Up @@ -920,7 +920,7 @@ protected string ValidateMethodName(MethodInfo method)
}

[ConditionalFact]
public void Mutable_metadata_methods_have_expected_shape()
public virtual void Mutable_metadata_methods_have_expected_shape()
{
var errors =
Fixture.MetadataMethods
Expand All @@ -933,7 +933,7 @@ public void Mutable_metadata_methods_have_expected_shape()
"\r\n-- Errors: --\r\n" + string.Join(Environment.NewLine, errors));
}

private string ValidateMutableMethod(MethodInfo mutableMethod)
protected virtual string ValidateMutableMethod(MethodInfo mutableMethod)
{
var message = ValidateMethodName(mutableMethod);
if (message != null)
Expand Down Expand Up @@ -973,7 +973,7 @@ private string ValidateMutableMethod(MethodInfo mutableMethod)
}

[ConditionalFact]
public void Convention_metadata_methods_have_expected_shape()
public virtual void Convention_metadata_methods_have_expected_shape()
{
var errors =
Fixture.MetadataMethods
Expand All @@ -986,7 +986,7 @@ public void Convention_metadata_methods_have_expected_shape()
"\r\n-- Errors: --\r\n" + string.Join(Environment.NewLine, errors));
}

private string ValidateConventionMethod(MethodInfo conventionMethod, Type type)
protected virtual string ValidateConventionMethod(MethodInfo conventionMethod, Type type)
{
var message = ValidateMethodName(conventionMethod);
if (message != null)
Expand Down
Loading