public void DoStuff(string connectionString)
 {
     using (ISqlWrapper sqlWrapper = _sqlWrapperFactory.CreateInstance(connectionString))
     {
         CommandText = "Select * from Table*";
         Execute();
     }
 }
Exemplo n.º 2
0
        public DisallowedSqlInjectionQueryHandler(ISqlWrapper sqlWrapper)
        {
            if (sqlWrapper == null)
            {
                throw new ArgumentNullException(nameof(sqlWrapper));
            }

            _sqlWrapper = sqlWrapper;
        }
Exemplo n.º 3
0
        public InitializeDatabaseCommandHandler(ISqlWrapper sqlWrapper)
        {
            if (sqlWrapper == null)
            {
                throw new ArgumentNullException(nameof(sqlWrapper));
            }

            _sqlWrapper = sqlWrapper;
        }
Exemplo n.º 4
0
 public IqAccountCommandHandlers(
     ISqlWrapper sqlWrapper,
     IBusSender <ActiveAccountQueue, SetActiveAccountStatusItem> activeAccountBusSender,
     IRepository <IqOptionAccountDto> iqAccountRepository, ILogger <IqAccountCommandHandlers> logger)
 {
     _sqlWrapper             = sqlWrapper;
     _activeAccountBusSender = activeAccountBusSender;
     _iqAccountRepository    = iqAccountRepository;
     _logger = logger;
 }
Exemplo n.º 5
0
        public void WhenIInsertANewAttachmentTheCommandIsRecieved()
        {
            //Arranging
            ISqlWrapper   sqlWrapper = Substitute.For <ISqlWrapper>();
            IMcAttachment payload    = new McAttachment();

            _target = new McAttachmentRepository(sqlWrapper);

            //Act
            _target.Insert(payload);

            //Assert
            sqlWrapper.Connection().Received();
            sqlWrapper.Command().Received();
        }
Exemplo n.º 6
0
 public GetIqAccountByIqUserIdQueryHandler(IMapper mapper, ISqlWrapper sqlWrapper)
 {
     _mapper     = mapper;
     _sqlWrapper = sqlWrapper;
 }
 public McAttachmentRepository(ISqlWrapper sqlWrapper)
 {
     _sqlWrapper = sqlWrapper;
 }