TestHelpers TestHelpers Class

Definition

public class TestHelpers
Public Class TestHelpers
Inheritance
System.ObjectSystem.Object
TestHelpersTestHelpers

Inherited Members

System.Object

System.Object.ToString()System.Object.ToString()
System.Object.Equals(System.Object)System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()System.Object.GetHashCode()
System.Object.GetType()System.Object.GetType()
System.Object.MemberwiseClone()System.Object.MemberwiseClone()

Constructors

TestHelpers() TestHelpers()

protected TestHelpers()
Protected Sub New

Properties

Instance Instance

public static TestHelpers Instance { get; }
Public Shared ReadOnly Property Instance As TestHelpers

Methods

AddProviderServices(IServiceCollection) AddProviderServices(IServiceCollection)

public virtual IServiceCollection AddProviderServices(IServiceCollection services)
Public Overridable Function AddProviderServices(services As IServiceCollection) As IServiceCollection
Parameters
services
IServiceCollection IServiceCollection
Returns
IServiceCollection IServiceCollection

AssertResults(IList, IList, Boolean, Action<>, IList>) AssertResults(Of T)(IList(Of T), IList(Of T), Boolean, Action(Of IList(Of T), IList(Of T)))

public static int AssertResults<T>(IList<T> expected, IList<T> actual, bool assertOrder, Action<IList<T>, IList<T>> asserter = null)
Public Shared Function AssertResults(Of T)(expected As IList(Of T), actual As IList(Of T), assertOrder As Boolean, asserter As Action(Of IList(Of T), IList(Of T)) = Nothing) As Integer
Type Parameters
T
Parameters
expected
System.Collections.Generic.IList<T> System.Collections.Generic.IList(Of T)
actual
System.Collections.Generic.IList<T> System.Collections.Generic.IList(Of T)
assertOrder
System.Boolean System.Boolean
asserter
System.Action<System.Collections.Generic.IList<T>, System.Collections.Generic.IList<T>> System.Action(Of System.Collections.Generic.IList(Of T), System.Collections.Generic.IList(Of T))
Returns
System.Int32 System.Int32

BuildModelFor() BuildModelFor(Of TEntity)()

public IMutableModel BuildModelFor<TEntity>()where TEntity : class
Public Function BuildModelFor(Of TEntity As Class) As IMutableModel
Type Parameters
TEntity
Returns

CreateContext() CreateContext()

public DbContext CreateContext()
Public Function CreateContext As DbContext
Returns

CreateContext(IServiceCollection) CreateContext(IServiceCollection)

public DbContext CreateContext(IServiceCollection customServices)
Public Function CreateContext(customServices As IServiceCollection) As DbContext
Parameters
customServices
IServiceCollection IServiceCollection
Returns

CreateContext(IServiceCollection, DbContextOptions) CreateContext(IServiceCollection, DbContextOptions)

public DbContext CreateContext(IServiceCollection customServices, DbContextOptions options)
Public Function CreateContext(customServices As IServiceCollection, options As DbContextOptions) As DbContext
Parameters
customServices
IServiceCollection IServiceCollection
Returns

CreateContext(IServiceCollection, IModel) CreateContext(IServiceCollection, IModel)

public DbContext CreateContext(IServiceCollection customServices, IModel model)
Public Function CreateContext(customServices As IServiceCollection, model As IModel) As DbContext
Parameters
customServices
IServiceCollection IServiceCollection
model
IModel IModel
Returns

CreateContext(DbContextOptions) CreateContext(DbContextOptions)

public DbContext CreateContext(DbContextOptions options)
Public Function CreateContext(options As DbContextOptions) As DbContext
Parameters
Returns

CreateContext(IModel) CreateContext(IModel)

public DbContext CreateContext(IModel model)
Public Function CreateContext(model As IModel) As DbContext
Parameters
model
IModel IModel
Returns

CreateContext(IServiceProvider) CreateContext(IServiceProvider)

public DbContext CreateContext(IServiceProvider serviceProvider)
Public Function CreateContext(serviceProvider As IServiceProvider) As DbContext
Parameters
serviceProvider
System.IServiceProvider System.IServiceProvider
Returns

CreateContext(IServiceProvider, DbContextOptions) CreateContext(IServiceProvider, DbContextOptions)

public DbContext CreateContext(IServiceProvider serviceProvider, DbContextOptions options)
Public Function CreateContext(serviceProvider As IServiceProvider, options As DbContextOptions) As DbContext
Parameters
serviceProvider
System.IServiceProvider System.IServiceProvider
Returns

CreateContext(IServiceProvider, IModel) CreateContext(IServiceProvider, IModel)

public DbContext CreateContext(IServiceProvider serviceProvider, IModel model)
Public Function CreateContext(serviceProvider As IServiceProvider, model As IModel) As DbContext
Parameters
serviceProvider
System.IServiceProvider System.IServiceProvider
model
IModel IModel
Returns

CreateContextServices() CreateContextServices()

public IServiceProvider CreateContextServices()
Public Function CreateContextServices As IServiceProvider
Returns
System.IServiceProvider System.IServiceProvider

CreateContextServices(IServiceCollection) CreateContextServices(IServiceCollection)

public IServiceProvider CreateContextServices(IServiceCollection customServices)
Public Function CreateContextServices(customServices As IServiceCollection) As IServiceProvider
Parameters
customServices
IServiceCollection IServiceCollection
Returns
System.IServiceProvider System.IServiceProvider

CreateContextServices(IServiceCollection, DbContextOptions) CreateContextServices(IServiceCollection, DbContextOptions)

public IServiceProvider CreateContextServices(IServiceCollection customServices, DbContextOptions options)
Public Function CreateContextServices(customServices As IServiceCollection, options As DbContextOptions) As IServiceProvider
Parameters
customServices
IServiceCollection IServiceCollection
Returns
System.IServiceProvider System.IServiceProvider

CreateContextServices(IServiceCollection, IModel) CreateContextServices(IServiceCollection, IModel)

public IServiceProvider CreateContextServices(IServiceCollection customServices, IModel model)
Public Function CreateContextServices(customServices As IServiceCollection, model As IModel) As IServiceProvider
Parameters
customServices
IServiceCollection IServiceCollection
model
IModel IModel
Returns
System.IServiceProvider System.IServiceProvider

CreateContextServices(DbContextOptions) CreateContextServices(DbContextOptions)

public IServiceProvider CreateContextServices(DbContextOptions options)
Public Function CreateContextServices(options As DbContextOptions) As IServiceProvider
Parameters
Returns
System.IServiceProvider System.IServiceProvider

CreateContextServices(IModel) CreateContextServices(IModel)

public IServiceProvider CreateContextServices(IModel model)
Public Function CreateContextServices(model As IModel) As IServiceProvider
Parameters
model
IModel IModel
Returns
System.IServiceProvider System.IServiceProvider

CreateContextServices(IServiceProvider) CreateContextServices(IServiceProvider)

public IServiceProvider CreateContextServices(IServiceProvider serviceProvider)
Public Function CreateContextServices(serviceProvider As IServiceProvider) As IServiceProvider
Parameters
serviceProvider
System.IServiceProvider System.IServiceProvider
Returns
System.IServiceProvider System.IServiceProvider

CreateContextServices(IServiceProvider, DbContextOptions) CreateContextServices(IServiceProvider, DbContextOptions)

public IServiceProvider CreateContextServices(IServiceProvider serviceProvider, DbContextOptions options)
Public Function CreateContextServices(serviceProvider As IServiceProvider, options As DbContextOptions) As IServiceProvider
Parameters
serviceProvider
System.IServiceProvider System.IServiceProvider
Returns
System.IServiceProvider System.IServiceProvider

CreateContextServices(IServiceProvider, IModel) CreateContextServices(IServiceProvider, IModel)

public IServiceProvider CreateContextServices(IServiceProvider serviceProvider, IModel model)
Public Function CreateContextServices(serviceProvider As IServiceProvider, model As IModel) As IServiceProvider
Parameters
serviceProvider
System.IServiceProvider System.IServiceProvider
model
IModel IModel
Returns
System.IServiceProvider System.IServiceProvider

CreateConventionBuilder() CreateConventionBuilder()

public ModelBuilder CreateConventionBuilder()
Public Function CreateConventionBuilder As ModelBuilder
Returns

CreateInternalEntry(IModel, EntityState, TEntity) CreateInternalEntry(Of TEntity)(IModel, EntityState, TEntity)

public InternalEntityEntry CreateInternalEntry<TEntity>(IModel model, EntityState entityState = EntityState.Detached, TEntity entity = null)where TEntity : class, new ()
Public Function CreateInternalEntry(Of TEntity As {Class, New})(model As IModel, entityState As EntityState = EntityState.Detached, entity As TEntity = Nothing) As InternalEntityEntry
Type Parameters
TEntity
Parameters
model
IModel IModel
entityState
EntityState EntityState
entity
TEntity TEntity
Returns

CreateOptions(IModel, IServiceProvider) CreateOptions(IModel, IServiceProvider)

public DbContextOptions CreateOptions(IModel model, IServiceProvider serviceProvider = null)
Public Function CreateOptions(model As IModel, serviceProvider As IServiceProvider = Nothing) As DbContextOptions
Parameters
model
IModel IModel
serviceProvider
System.IServiceProvider System.IServiceProvider
Returns

CreateOptions(IServiceProvider) CreateOptions(IServiceProvider)

public DbContextOptions CreateOptions(IServiceProvider serviceProvider = null)
Public Function CreateOptions(serviceProvider As IServiceProvider = Nothing) As DbContextOptions
Parameters
serviceProvider
System.IServiceProvider System.IServiceProvider
Returns

CreateServiceProvider(IServiceCollection) CreateServiceProvider(IServiceCollection)

public IServiceProvider CreateServiceProvider(IServiceCollection customServices = null)
Public Function CreateServiceProvider(customServices As IServiceCollection = Nothing) As IServiceProvider
Parameters
customServices
IServiceCollection IServiceCollection
Returns
System.IServiceProvider System.IServiceProvider

UseProviderOptions(DbContextOptionsBuilder) UseProviderOptions(DbContextOptionsBuilder)

protected virtual void UseProviderOptions(DbContextOptionsBuilder optionsBuilder)
Protected Overridable Sub UseProviderOptions(optionsBuilder As DbContextOptionsBuilder)
Parameters