SnapDAL Library Documentation

MockProvider Members

MockProvider overview

Public Static Fields

TestName The name of the currently executing test. Used for matching mock readers and data for statements
TestParams A key/value dictionary of test parameters. Used to pass parameters to queries when the original query being mocked might not have them, and to select specific test datasets based on parameters. The key is the name of a query, the value is a HybridDictionary of parameter name, parameter value.

Public Instance Properties

Name The provider name
ParamTypeMappings (inherited from Provider) The parameter type mapping associated with the provider. See the documentation
Providers (inherited from DelegateProvider) 
Statements (inherited from Provider) The statement manager and cache.

Public Instance Methods

AddProvider (inherited from DelegateProvider)Overloaded.  
CreateCommand (inherited from Provider) Create a command for this provider. In this version, the actual sql is used instead of a statement name
CreateConnection (inherited from Provider) Create a Connection for this provider
CreateDataAdapterOverloaded. Create a DataAdapter for this provider
CreateParameter (inherited from Provider)Overloaded. Create a parameter for this provider and set the value
CreateParameterOverloaded. Create a parameter.
CreateTestRecorder Take the given DataFactory and replace it with one that will completely record a series of calls and setup the test configuration so the recorded calls can be used in a test. Assumes that the test name is set as this is required for congiguration setup.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetStatement (inherited from Provider)Overloaded. Looks up a statement from the manager. Allows for abstractions away from the StatementManager.
GetType (inherited from Object)Gets the Type of the current instance.
LoadMockReaderFromReader Given a data reader, create a mock data reader from it so you can use it in testing with expectations.
SetupCommand Setup the given MockCommand with expected readers, if any, based on the statement name and current test name
ToString (inherited from Object)Returns a String that represents the current Object.

Protected Instance Fields

_classTypes (inherited from Provider)A holder class for the types of objects a provider can create
_connections (inherited from DelegateProvider) Their default connection strings.
_paramTypes (inherited from Provider)The mapping of CLR/Types to DB types (enum values for each provider)
_providers (inherited from DelegateProvider) The real providers
_recordToDir (inherited from Provider) Do we record the data as we get it?
_statements (inherited from Provider)The StatmentmentManage who can cache and collect statements

Protected Instance Properties

DataDirectory gets the path to the mock data

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetStatement (inherited from Provider)Overloaded. Looks up a statement from the manager. Allows for abstractions away from the StatementManager.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

Protected Internal Instance Constructors

MockProvider Constructor ctor

Protected Internal Instance Methods

CreateDataAdapter (inherited from Provider)Overloaded. Create a DataAdapter for this provider
LoadDefaultParamTypes (inherited from Provider) Set up the default parameter types. This method is where the provider determines both the parameter types that are supported, as well as the mapping between the IDb types and the real parameter types.

See Also

MockProvider Class | SnapDAL.Providers Namespace