示例#1
0
        public void AppIDTestCase()
        {
            Thread.Sleep(2000);
            _executionEngineClient.Start();
            ManualResetEvent manualAppIDEvent = new ManualResetEvent(false);;

            manualAppIDEvent.WaitOne(3000, false);

            Assert.NotNull(true, _executionEngineClient.AppId, "App ID");
            Assert.AreEqual("A00", _executionEngineClient.AppId, "App ID Value");
        }
        /// <summary>
        /// Starts Order Execution Service
        /// </summary>
        public bool StartService()
        {
            try
            {
                if (_isConnected)
                {
                    if (_asyncClassLogger.IsInfoEnabled)
                    {
                        _asyncClassLogger.Info("Order execution service already running.", _type.FullName, "StartService");
                    }

                    return(true);
                }

                // Start OEE-Client
                _executionEngineClient.Start();

                if (_asyncClassLogger.IsInfoEnabled)
                {
                    _asyncClassLogger.Info("Order Execution service started.", _type.FullName, "StartService");
                }

                return(true);
            }
            catch (Exception exception)
            {
                _asyncClassLogger.Error(exception, _type.FullName, "StartService");
                return(false);
            }
        }
示例#3
0
        public void TestOrderExecutionLogin()
        {
            var    manualResetEvent      = new ManualResetEvent(false);
            string loginMessage          = null;
            var    executionEngineClient = new OrderExecutionEngineClient();

            executionEngineClient.Start();
            manualResetEvent.WaitOne(5000);
            executionEngineClient.LogoutArrived += delegate(string s)
            {
                loginMessage = s;
            };
            executionEngineClient.SendLoginRequest(new Login()
            {
                OrderExecutionProvider = Common.Core.Constants.OrderExecutionProvider.SimulatedExchange
            });
            manualResetEvent.WaitOne(5000);
            executionEngineClient.SendMarketOrderRequest(new MarketOrder("1", OrderSide.BUY, 10, "123", "USD",
                                                                         new Security {
                Symbol = "AAPL"
            },
                                                                         Common.Core.Constants.OrderExecutionProvider.
                                                                         SimulatedExchange));
            manualResetEvent.WaitOne(5000);
            executionEngineClient.Shutdown();
            System.Console.WriteLine(loginMessage);
            Assert.AreEqual(false, string.IsNullOrEmpty(loginMessage));
        }
示例#4
0
 public void Setup()
 {
     _marketDataEngineClient = new MarketDataEngineClient();
     _orderExecutionEngine   = new OrderExecutionEngineClient();
     _marketDataEngineClient.Start();
     _orderExecutionEngine.Start();
 }