Exemple #1
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"
     };
 }
Exemple #2
0
        public void Start(int port)
        {
            var url = ServiceUrl();

            var context = new InstanceContext(_migrationNumberSync);
            var binding = new NetPeerTcpBinding();

            binding.Security.Mode = SecurityMode.None;
            binding.Resolver.Mode = PeerResolverMode.Pnrp;
            binding.Port          = port;
            binding.Name          = url + "@" + port;

            var address        = new EndpointAddress(url);
            var channelFactory = new DuplexChannelFactory <IMigrationNumberSync>(context, binding, address);

            var proxy = channelFactory.CreateChannel();

            SetupRemoteOnlyPropogationFilter(((IClientChannel)proxy));

            ((IClientChannel)proxy).Open();

            Channel = proxy;
        }
Exemple #3
0
 public MigrationNumberSyncPeer(IMigrationNumberSync migrationNumberSync)
 {
     _migrationNumberSync = migrationNumberSync;
 }