Esempio n. 1
0
        public IDbDataParameter AddParameter(IDbCommand command, string name, object value, Type type)
        {
            //ServiceRegistration.Get<ILogger>().Info("Adding " + name + "=" + value + "(" + type + ") to " + command);
            IDbDataParameter parameter = command.CreateParameter();

            parameter.ParameterName = name;
            parameter.Value         = value;
            parameter.DbType        = MockDBUtils.GetType(type);
            command.Parameters.Add(parameter);

            return(parameter);
        }
Esempio n. 2
0
        public IDbCommand CreateCommand()
        {
            IDbCommand command;

            if (MockDBUtils.Connection != null)
            {
                command = MockDBUtils.Connection.CreateCommand();
                command = new LoggingDbCommandWrapper(command);
            }
            else
            {
                command = new MockCommand();
                MockDBUtils.AddCommand((MockCommand)command);
            }

            return(command);
        }
Esempio n. 3
0
 public IDataReader ExecuteReader(CommandBehavior behavior)
 {
     return(MockDBUtils.GetReader(_commandText, GetFormattedSql()));
 }