public void SubscribeEvents()
 {
     Initialize();
     try
     {
         _logger.DebugFormat("Remote subscriber subscribes event on '{0}'.", this);
         var subscriber = _callbackChannelProvider.GetCallbackChannel <ICommonServicesEvents>();
         _moduleInitializationStarted += subscriber.ModuleInitializationStarted;
     }
     catch (Exception e)
     {
         _logger.Error(e.Message, e);
         throw new FaultException <CommonServicesFault>(new CommonServicesFault(), e.Message);
     }
 }
示例#2
0
 public MigrationNumberSyncServiceTests()
 {
     _eventPublisher          = Substitute.For <IEventPublisher>();
     _callbackChannelProvider = Substitute.For <ICallbackChannelProvider>();
     _callbackService         = Substitute.For <IMigrationNumberSync>();
     _callbackChannelProvider.GetCallbackChannel <IMigrationNumberSync>().Returns(_callbackService);
     _syncService = new MigrationNumberSyncService(_eventPublisher, _callbackChannelProvider);
     _migration   = new Migration {
         ProjectId = "1", Number = "2"
     };
 }