예제 #1
0
        public GASender()
        {
            InitializeComponent();

            _logger = LogManager.GetLogger(GetType().Name);
            try
            {
                var busConfiguration = ConfigService.Instance.Bus;

                if (busConfiguration == null)
                {
                    throw new Exception("BusConfiguration must be set in config");
                }

                var kernel = new StandardKernel();

                kernel.Bind <IMessageBodySerializer>().To <DefaultJsonSerializer>().InSingletonScope();
                kernel.Bind <IBusLogger>().To <CustomNLogger>().InSingletonScope();

                NinjectContainerAdapter.CreateInstance(kernel);
                BusFactory.SetContainerFactory(NinjectContainerAdapter.GetInstance);
                _messageBus = BusFactory.CreateBus();

                _repository = new Repository.Repository(ConfigService.Instance.Payments.W1ConnectionString);

                _sendService = new PaymentsService(
                    _repository,
                    ConfigService.Instance.Common.GoogleAnaliticsUrl,
                    ConfigService.Instance.Common.TrackingId,
                    ConfigService.Instance.Payments.Interval,
                    ConfigService.Instance.Common.GoogleAnaliticsTimeout,
                    ConfigService.Instance.Payments.StartTime,
                    ConfigService.Instance);
            }
            catch (Exception exception)
            {
                _logger.Error(exception);
                throw;
            }
        }
예제 #2
0
 public MonitorService(IEasyNetQBus messageBus, IDateFromUpdater dateFromUpdater, IRepository repository)
 {
     _messageBus      = messageBus;
     _dateFromUpdater = dateFromUpdater;
     _repository      = repository;
 }
예제 #3
0
 public EventTransportTests()
 {
     easyNetQBus = Substitute.For <IEasyNetQBus>();
     sut         = new EventTransport <Event2, Event1>(easyNetQBus);
 }
예제 #4
0
 public EventTransport(IEasyNetQBus easyNetQBus)
 {
     this.easyNetQBus = easyNetQBus;
 }