Пример #1
0
 public DispatcherClientTests()
 {
     _server = Substitute.For<ITalkToServer>();
     _err = Substitute.For<IDeliveryErrorsQueue>();
     _sut =new DispatcherClient(Setup.TestEndpoint.Host,_server,_err,new BusAuditor(new InMemoryAuditStorage()));
     _config = SetupFakeConfig();
     _sut.SubscribeToServer(new []{_config});
 }
Пример #2
0
 public DispatcherClient(string hostName,ITalkToServer server, IDeliveryErrorsQueue errors ,BusAuditor auditor)
 {
     server.MustNotBeNull();
     _hostName = hostName;
     _server = server;
     _errors = errors;
     _auditor = auditor;
 }
Пример #3
0
 public DispatcherClient(string hostName, ITalkToServer server, IDeliveryErrorsQueue errors, BusAuditor auditor)
 {
     server.MustNotBeNull();
     _hostName = hostName;
     _server   = server;
     _errors   = errors;
     _auditor  = auditor;
 }
Пример #4
0
 public DispatcherClientTests()
 {
     _server = Substitute.For <ITalkToServer>();
     _err    = Substitute.For <IDeliveryErrorsQueue>();
     _sut    = new DispatcherClient(Setup.TestEndpoint.Host, _server, _err, new BusAuditor(new InMemoryAuditStorage()));
     _config = SetupFakeConfig();
     _sut.SubscribeToServer(new [] { _config });
 }
        public ClientToServerTests()
        {
            _disp = Substitute.For <IConfigureDispatcher>();
            _disp.TalkUsing(Arg.Do <ITalkToServer>(v => _clientToServer = v));
            _disp.CommunicateBySqlStorage(Setup.GetConnection(), ifExists: TableExistsAction.DropIt);

            _cfg = new DispatchServerConfiguration();
            _cfg.ReceiveFromClientsBySql(Setup.GetConnection());



            _serverConfig = Substitute.For <IWantEndpointUpdates>();
            _serverRoute  = Substitute.For <IRouteMessages>();

            _cfg.Storage             = Substitute.For <IStoreDispatcherServerState>();
            _cfg.DeliveryErrorsQueue = Substitute.For <IDeliveryErrorsQueue>();



            _cfg.EndpointUpdatesNotifier.Subscribe(_serverConfig);
            _cfg.MessageNotifier.Subscribe(_serverRoute);
        }
        public ClientToServerTests()
        {
            _disp = Substitute.For<IConfigureDispatcher>();
            _disp.TalkUsing(Arg.Do<ITalkToServer>(v => _clientToServer = v));
            _disp.CommunicateBySqlStorage(Setup.GetConnection(), ifExists: TableExistsAction.DropIt);

            _cfg = new DispatchServerConfiguration();
            _cfg.ReceiveFromClientsBySql(Setup.GetConnection());

           

            _serverConfig = Substitute.For<IWantEndpointUpdates>();
            _serverRoute = Substitute.For<IRouteMessages>();

            _cfg.Storage = Substitute.For<IStoreDispatcherServerState>();
            _cfg.DeliveryErrorsQueue = Substitute.For<IDeliveryErrorsQueue>();

        

            _cfg.EndpointUpdatesNotifier.Subscribe(_serverConfig);
            _cfg.MessageNotifier.Subscribe(_serverRoute);


        }
Пример #7
0
 public IConfigureDispatcher TalkUsing(ITalkToServer communicator)
 {
     communicator.MustNotBeNull();
     Communicator = communicator;
     return(this);
 }
Пример #8
0
 public IConfigureDispatcher TalkUsing(ITalkToServer communicator)
 {
     communicator.MustNotBeNull();
     Communicator = communicator;
     return this;
 }