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);


        }
Beispiel #3
0
 public static IConfigureDispatcher CommunicateBySqlServerStorage(this IConfigureDispatcher cfg, string cnxString, string table = Sql.Extensions.CommunicatorTable, string dbSchema = Sql.Extensions.CommunicatorSchema, TableExistsAction ifExists = TableExistsAction.Ignore)
 {
     return(cfg.CommunicateBySqlStorage(GetFactory(cnxString), table, dbSchema, ifExists));
 }
 /// <summary>
 /// Doesn't communicate with the server
 /// </summary>
 /// <param name="cfg"></param>
 /// <returns></returns>
 public static IConfigureDispatcher LocalDispatcher(this IConfigureDispatcher cfg) => cfg.TalkUsing(NullServerConnector.Instance).ReceiveMessagesUsing(NullReceiver.Instance);
Beispiel #5
0
 public static IConfigureDispatcher CommunicateBySqlStorage(this IConfigureDispatcher cfg, IDbFactory connection, string table = CommunicatorTable, string dbSchema = CommunicatorSchema, TableExistsAction ifExists = TableExistsAction.Ignore)
 {
     new ClientToServerRowCreator(connection).WithTableName(table, dbSchema).IfExists(ifExists).Create();
     return(cfg.TalkUsing(new ClientToServer(connection)));
 }