private void AddParameter(IPostgresCommand command, DbType dbType, ParameterDirection direction, string name, object value) { IPostgresParameter param = command.CreateParameter(); param.DbType = dbType; param.Direction = direction; param.ParameterName = name; param.Value = value; command.Parameters.Add(param); }
public PostgresReadModelUserRepositoryTests() { fixture = new Fixture(); parameterCollection = Substitute.For <IPostgresParameterCollection>(); command = Substitute.For <IPostgresCommand>(); transaction = Substitute.For <IPostgresTransaction>(); connection = Substitute.For <IPostgresConnection>(); command.CreateParameter().Returns(args => Substitute.For <IPostgresParameter>()); command.Parameters.Returns(parameterCollection); connection.CreateCommand().Returns(command); connection.BeginTransaction().Returns(transaction); repository = new PostgresReadModelUserRepository(connection); }