示例#1
0
        public void Setup()
        {
            this.stServerSingleton = new StServerMockSingleton();
            this.stServer          = this.stServerSingleton.Instance;
            this.handlers          = new SmartComHandlersDatabase();
            this.handlers.Add <_IStClient_ConnectedEventHandler>(ConnectedHandler);
            this.handlers.Add <_IStClient_DisconnectedEventHandler>(DisconnectedHandler);
            this.binder     = new SmartComBinder(this.stServer, this.handlers, new NullLogger());
            this.connector  = new SmartComConnector(this.stServer, this.handlers, new NullLogger());
            this.subscriber = new SmartComSubscriber(this.stServer, new NullLogger());
            this.subscriber.Portfolios.Add("ST88888-RF-01");
            this.subscriber.Ticks.Add("RTS-6.13_FT");
            this.subscriber.Quotes.Add("RTS-6.13_FT");
            this.subscriber.BidsAndAsks.Add("RTS-6.13_FT");

            this.trader = new SmartComAdapter(this.connector,
                                              this.handlers,
                                              this.binder,
                                              this.subscriber,
                                              this.stServerSingleton,
                                              new NullLogger(),
                                              1);

            Assert.AreEqual(0, this.subscriber.SubscriptionsCounter);
        }
示例#2
0
 public void Setup()
 {
     this.stServer  = new StServerClassMock();
     this.handlers  = new SmartComHandlersDatabase();
     this.binder    = new SmartComBinder(this.stServer, this.handlers, new NullLogger());
     this.connector = new SmartComConnector(this.stServer, this.handlers, new NullLogger());
     this.binder.Bind();
 }
示例#3
0
 public FakeAdapterBase()
 {
     this.handlers      = new SmartComHandlersDatabase();
     this.mockSingleton = new StServerMockSingleton();
     this.subscriber    = new SmartComSubscriber(this.mockSingleton.Instance, new NullLogger());
     this.binder        = new SmartComBinder(this.mockSingleton.Instance, this.handlers, new NullLogger());
     this.connector     = new SmartComConnector(this.mockSingleton.Instance, this.handlers, new NullLogger());
 }