public void OrderFillExecutionPriceQueryTest()
        {
            IOrderRepository orderRespository = ContextRegistry.GetContext()["OrderRespository"] as IOrderRepository;
            var orderReportManager            = new OrderReportManager(orderRespository);

            var dataEventReceived = false;
            var manualDataEvent   = new ManualResetEvent(false);

            IList <object[]> report = null;
            var arguments           = new Dictionary <OrderParameters, string>();

            // Add Filter Parameters
            arguments.Add(OrderParameters.ExecutionPrice, "65");

            // Hook Data Event
            orderReportManager.DataReceived += delegate(IList <object[]> obj)
            {
                report            = obj;
                dataEventReceived = true;
                manualDataEvent.Set();
            };

            // Request Report Data
            orderReportManager.RequestReport(arguments);

            manualDataEvent.WaitOne(2000);

            Assert.IsNotNull(report);
            Assert.IsTrue(dataEventReceived, "Report Event");
            Assert.Greater(report.Count, 0, "Return Count");
        }
        public void OrderQueryTest()
        {
            IOrderRepository orderRespository = ContextRegistry.GetContext()["OrderRespository"] as IOrderRepository;
            var orderReportManager            = new OrderReportManager(orderRespository);

            var dataEventReceived = false;
            var manualDataEvent   = new ManualResetEvent(false);

            IList <object[]> report = null;
            var arguments           = new Dictionary <OrderParameters, string>();

            // Add Filter Parameters
            arguments.Add(OrderParameters.OrderSide, "BUY");
            //arguments.Add(OrderParameters.OrderStatus, "CANCELLED,OPEN,EXECUTED");
            //arguments.Add(OrderParameters.StartOrderDateTime, "2013-06-20 09:30:00");
            //arguments.Add(OrderParameters.EndOrderDateTime, "2013-06-20 09:31:00");
            //arguments.Add(OrderParameters.OrderSize, "13");

            // Hook Data Event
            orderReportManager.DataReceived += delegate(IList <object[]> obj)
            {
                report            = obj;
                dataEventReceived = true;
                manualDataEvent.Set();
            };

            // Request Report Data
            orderReportManager.RequestReport(arguments);

            manualDataEvent.WaitOne(200000);

            Assert.IsNotNull(report);
            Assert.IsTrue(dataEventReceived, "Report Event");
            Assert.Greater(report.Count, 0, "Return Count");
        }
 /// <summary>
 /// Handles incoming Order Report Request
 /// </summary>
 /// <param name="parameters">Search parameters to be used for report</param>
 private void FetchOrderReportData(Dictionary <OrderParameters, string> parameters)
 {
     // Forward Request to Order Report Manager
     _orderReportManager.RequestReport(parameters);
 }