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; } }
public MonitorService(IEasyNetQBus messageBus, IDateFromUpdater dateFromUpdater, IRepository repository) { _messageBus = messageBus; _dateFromUpdater = dateFromUpdater; _repository = repository; }
public EventTransportTests() { easyNetQBus = Substitute.For <IEasyNetQBus>(); sut = new EventTransport <Event2, Event1>(easyNetQBus); }
public EventTransport(IEasyNetQBus easyNetQBus) { this.easyNetQBus = easyNetQBus; }