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" }; }
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; }
public MigrationNumberSyncPeer(IMigrationNumberSync migrationNumberSync) { _migrationNumberSync = migrationNumberSync; }