public void TestCanReuse()
        {
            AgentInstanceContext agentInstanceContext = SupportStatementContextFactory.MakeAgentInstanceContext();

            _factory.SetViewParameters(null, TestViewSupport.ToExprListBean(new Object[] { "IntPrimitive" }));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportBean)), SupportStatementContextFactory.MakeContext(), null, null);
            Assert.IsFalse(_factory.CanReuse(new FirstElementView(null), agentInstanceContext));
        }
Exemple #2
0
 public void TestCanReuse()
 {
     _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(new Object[] { "Symbol", "Feed" }));
     _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, _parents);
     Assert.IsFalse(_factory.CanReuse(new FirstElementView(null)));
     Assert.IsFalse(_factory.CanReuse(new MergeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(), SupportExprNodeFactory.MakeIdentNodesMD("Symbol"), null, true)));
     Assert.IsTrue(_factory.CanReuse(new MergeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(), SupportExprNodeFactory.MakeIdentNodesMD("Symbol", "Feed"), null, true)));
 }
        private void TryParameter(Object[] @params, String fieldName)
        {
            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(@params));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
            UnivariateStatisticsView view = (UnivariateStatisticsView)_factory.MakeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext());

            Assert.AreEqual(fieldName, view.FieldExpression.ToExpressionStringMinPrecedenceSafe());
        }
Exemple #4
0
        public void TestAttaches()
        {
            // Should attach to anything as long as the fields exists
            EventType parentType = SupportEventTypeFactory.CreateBeanType(
                typeof(SupportBean));

            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListBean(new Object[] { "IntBoxed" }));
            _factory.Attach(parentType, SupportStatementContextFactory.MakeContext(_container), null, null);
        }
Exemple #5
0
        private void TryParameter(object[] parameters, string fieldNameX, string fieldNameY)
        {
            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(parameters));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
            CorrelationView view = (CorrelationView)_factory.MakeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext());

            Assert.AreEqual(fieldNameX, ExprNodeUtility.ToExpressionStringMinPrecedenceSafe(view.ExpressionX));
            Assert.AreEqual(fieldNameY, ExprNodeUtility.ToExpressionStringMinPrecedenceSafe(view.ExpressionY));
        }
        private void TryParameter(Object[] @params, String fieldNameX, String fieldNameY)
        {
            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(@params));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(_container), null, null);
            RegressionLinestView view = (RegressionLinestView)_factory.MakeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container));

            Assert.AreEqual(fieldNameX, view.ExpressionX.ToExpressionStringMinPrecedenceSafe());
            Assert.AreEqual(fieldNameY, view.ExpressionY.ToExpressionStringMinPrecedenceSafe());
        }
        public void TestIntervalWait()
        {
            var factory = new TimerIntervalObserverFactory();

            factory.SetObserverParameters(TestViewSupport.ToExprListBean(new Object[] { 1 }), new SupportMatchedEventConvertor(), null);
            var eventObserver = factory.MakeObserver(_patternContext, null, new SupportObserverEventEvaluator(_patternContext), null, null, false);

            Assert.IsTrue(eventObserver is TimerIntervalObserver);
        }
        private void TryParameter(Object param, String fieldName)
        {
            UniqueByPropertyViewFactory factory = new UniqueByPropertyViewFactory();

            factory.SetViewParameters(null, TestViewSupport.ToExprListBean(new Object[] { param }));
            factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportBean)), SupportStatementContextFactory.MakeContext(), null, null);
            UniqueByPropertyView view = (UniqueByPropertyView)factory.MakeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext());

            Assert.AreEqual(fieldName, view.CriteriaExpressions[0].ToExpressionStringMinPrecedenceSafe());
        }
Exemple #9
0
        public void SetUp()
        {
            _factory = new MergeViewFactory();

            _parents = new List <ViewFactory>();
            GroupByViewFactory groupByView = new GroupByViewFactory();

            groupByView.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(new Object[] { "Symbol", "Feed" }));
            groupByView.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
            _parents.Add(groupByView);
        }
        public void TestCanReuse()
        {
            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(new Object[] { "Price", "Volume" }));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
            Assert.IsFalse(_factory.CanReuse(new FirstElementView(null)));
            EventType type = RegressionLinestView.CreateEventType(SupportStatementContextFactory.MakeContext(), null, 1);

            Assert.IsFalse(_factory.CanReuse(new RegressionLinestView(null, SupportStatementContextFactory.MakeAgentInstanceContext(), SupportExprNodeFactory.MakeIdentNodeMD("Price"), SupportExprNodeFactory.MakeIdentNodeMD("Price"), type, null)));
            Assert.IsFalse(_factory.CanReuse(new RegressionLinestView(null, SupportStatementContextFactory.MakeAgentInstanceContext(), SupportExprNodeFactory.MakeIdentNodeMD("Volume"), SupportExprNodeFactory.MakeIdentNodeMD("Price"), type, null)));
            Assert.IsTrue(_factory.CanReuse(new RegressionLinestView(null, SupportStatementContextFactory.MakeAgentInstanceContext(), SupportExprNodeFactory.MakeIdentNodeMD("Price"), SupportExprNodeFactory.MakeIdentNodeMD("Volume"), type, null)));
        }
Exemple #11
0
        private void TryParameter(Object[] paramList, String[] fieldNames, int size)
        {
            _factory.SetViewParameters(null, TestViewSupport.ToExprListMD(paramList));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
            SortWindowView view = (SortWindowView)_factory.MakeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext());

            Assert.AreEqual(size, view.SortWindowSize);
            Assert.AreEqual(fieldNames[0], view.SortCriteriaExpressions[0].ToExpressionStringMinPrecedenceSafe());
            if (fieldNames.Length > 0)
            {
                Assert.AreEqual(fieldNames[1], view.SortCriteriaExpressions[1].ToExpressionStringMinPrecedenceSafe());
            }
        }
Exemple #12
0
        private void TryParameter(Object[] parameters, String[] fieldNames)
        {
            var factory = new GroupByViewFactory();

            factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListBean(parameters));
            factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportBean)),
                           SupportStatementContextFactory.MakeContext(_container), null, null);
            var view = (GroupByView)factory.MakeView(
                SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container));

            Assert.AreEqual(fieldNames[0],
                            view.CriteriaExpressions[0].ToExpressionStringMinPrecedenceSafe());
        }
 private void TryInvalidParameter(Object[] @params)
 {
     try
     {
         _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(@params));
         _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
         Assert.Fail();
     }
     catch (ViewParameterException ex)
     {
         // expected
     }
 }
Exemple #14
0
        public void TestCanReuse()
        {
            AgentInstanceContext agentInstanceContext = SupportStatementContextFactory.MakeAgentInstanceContext(_container);

            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListBean(new Object[] { "TheString", "LongPrimitive" }));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportBean)), SupportStatementContextFactory.MakeContext(_container), null, null);
            Assert.IsFalse(_factory.CanReuse(new FirstElementView(null), agentInstanceContext));
            Assert.IsFalse(_factory.CanReuse(new GroupByViewImpl(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container), SupportExprNodeFactory.MakeIdentNodesBean("TheString"), null), agentInstanceContext));
            Assert.IsTrue(_factory.CanReuse(new GroupByViewImpl(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container), SupportExprNodeFactory.MakeIdentNodesBean("TheString", "LongPrimitive"), null), agentInstanceContext));

            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListBean(new Object[] { SupportExprNodeFactory.MakeIdentNodesBean("TheString", "LongPrimitive") }));
            Assert.IsFalse(_factory.CanReuse(new GroupByViewImpl(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container), SupportExprNodeFactory.MakeIdentNodesBean("TheString"), null), agentInstanceContext));
            Assert.IsTrue(_factory.CanReuse(new GroupByViewImpl(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container), SupportExprNodeFactory.MakeIdentNodesBean("TheString", "LongPrimitive"), null), agentInstanceContext));
        }
        private void TryParameter(Object[] parameters, String[] fieldNames)
        {
            MergeViewFactory factory = new MergeViewFactory();

            factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(parameters));
            factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(_container), null, _parents);
            MergeView view = (MergeView)factory.MakeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container));

            Assert.AreEqual(fieldNames[0], view.GroupFieldNames[0].ToExpressionStringMinPrecedenceSafe());
            if (fieldNames.Length > 0)
            {
                Assert.AreEqual(fieldNames[1], view.GroupFieldNames[1].ToExpressionStringMinPrecedenceSafe());
            }
        }
 private void TryInvalidParameter(Object[] parameters)
 {
     try
     {
         MergeViewFactory factory = new MergeViewFactory();
         factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(parameters));
         factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(_container), null, _parents);
         Assert.Fail();
     }
     catch (ViewParameterException)
     {
         // expected
     }
 }
 private void TryInvalidParameter(Object param)
 {
     try
     {
         UniqueByPropertyViewFactory factory = new UniqueByPropertyViewFactory();
         factory.SetViewParameters(null, TestViewSupport.ToExprListBean(new Object[] { param }));
         factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportBean)), SupportStatementContextFactory.MakeContext(_container), null, null);
         Assert.Fail();
     }
     catch (ViewParameterException)
     {
         // expected
     }
 }
Exemple #18
0
 private void TryInvalidParameter(Object[] param)
 {
     try
     {
         ExternallyTimedWindowViewFactory factory = new ExternallyTimedWindowViewFactory();
         factory.SetViewParameters(null, TestViewSupport.ToExprListBean(new Object[] { param }));
         factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportBean)), SupportStatementContextFactory.MakeContext(), null, null);
         Assert.Fail();
     }
     catch (ViewParameterException ex)
     {
         // expected
     }
 }
        public void TestCanReuse()
        {
            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(new Object[] { "Price", "Volume" }));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
            Assert.IsFalse(_factory.CanReuse(new FirstElementView(null)));
            EventType type = WeightedAverageView.CreateEventType(SupportStatementContextFactory.MakeContext(), null, 1);
            WeightedAverageViewFactory factoryTwo = new WeightedAverageViewFactory();

            factoryTwo.FieldNameX      = SupportExprNodeFactory.MakeIdentNodeMD("Price");
            factoryTwo.EventType       = type;
            factoryTwo.FieldNameWeight = SupportExprNodeFactory.MakeIdentNodeMD("Price");
            Assert.IsFalse(_factory.CanReuse(new WeightedAverageView(factoryTwo, SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext())));
            factoryTwo.FieldNameWeight = SupportExprNodeFactory.MakeIdentNodeMD("Volume");
            Assert.IsTrue(_factory.CanReuse(new WeightedAverageView(factoryTwo, SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext())));
        }
        private void TryInvalidParameter(Object[] parameters)
        {
            try
            {
                var factory = new GroupByViewFactory();

                factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListBean(parameters));
                factory.Attach(
                    SupportEventTypeFactory.CreateBeanType(typeof(SupportBean)),
                    SupportStatementContextFactory.MakeContext(), null, null);
                Assert.Fail();
            }
            catch (ViewParameterException ex)
            {
                // expected
            }
        }
Exemple #21
0
        public void TestCanReuse()
        {
            StatementContext context = SupportStatementContextFactory.MakeContext();

            _factory.SetViewParameters(null, TestViewSupport.ToExprListMD(new Object[] { 100, "Price" }));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
            Assert.IsFalse(_factory.CanReuse(new FirstElementView(null)));
            Assert.IsTrue(_factory.CanReuse(new SortWindowView(_factory, SupportExprNodeFactory.MakeIdentNodesMD("Price"), new ExprEvaluator[0], new bool[] { false }, 100, null, false, null)));
            Assert.IsFalse(_factory.CanReuse(new SortWindowView(_factory, SupportExprNodeFactory.MakeIdentNodesMD("Volume"), new ExprEvaluator[0], new bool[] { true }, 100, null, false, null)));
            Assert.IsFalse(_factory.CanReuse(new SortWindowView(_factory, SupportExprNodeFactory.MakeIdentNodesMD("Price"), new ExprEvaluator[0], new bool[] { false }, 99, null, false, null)));
            Assert.IsFalse(_factory.CanReuse(new SortWindowView(_factory, SupportExprNodeFactory.MakeIdentNodesMD("Symbol"), new ExprEvaluator[0], new bool[] { false }, 100, null, false, null)));

            _factory.SetViewParameters(null, TestViewSupport.ToExprListMD(new Object[] { 100, "Price", "Volume" }));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
            Assert.IsTrue(_factory.CanReuse(new SortWindowView(_factory, SupportExprNodeFactory.MakeIdentNodesMD("Price", "Volume"), new ExprEvaluator[0], new bool[] { false, false }, 100, null, false, null)));
            Assert.IsFalse(_factory.CanReuse(new SortWindowView(_factory, SupportExprNodeFactory.MakeIdentNodesMD("Price", "Symbol"), new ExprEvaluator[0], new bool[] { true, false }, 100, null, false, null)));
        }
Exemple #22
0
        public void TestCanReuse()
        {
            AgentInstanceContext agentInstanceContext = SupportStatementContextFactory.MakeAgentInstanceContext(_container);

            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(new Object[] { "Price" }));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(_container), null, null);
            Assert.IsFalse(_factory.CanReuse(new FirstElementView(null), agentInstanceContext));
            EventType type = UnivariateStatisticsView.CreateEventType(SupportStatementContextFactory.MakeContext(_container), null, 1);
            UnivariateStatisticsViewFactory factoryOne = new UnivariateStatisticsViewFactory();

            factoryOne.EventType       = type;
            factoryOne.FieldExpression = SupportExprNodeFactory.MakeIdentNodeMD("Volume");
            UnivariateStatisticsViewFactory factoryTwo = new UnivariateStatisticsViewFactory();

            factoryTwo.EventType       = type;
            factoryTwo.FieldExpression = SupportExprNodeFactory.MakeIdentNodeMD("Price");
            Assert.IsFalse(_factory.CanReuse(new UnivariateStatisticsView(factoryOne, SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container)), agentInstanceContext));
            Assert.IsTrue(_factory.CanReuse(new UnivariateStatisticsView(factoryTwo, SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container)), agentInstanceContext));
        }
Exemple #23
0
        public void TestAttaches()
        {
            // Should attach to anything as long as the fields exists
            EventType parentType = SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean));

            _factory.SetViewParameters(null, TestViewSupport.ToExprListMD(new Object[] { 100, "Price" }));
            _factory.Attach(parentType, SupportStatementContextFactory.MakeContext(), null, null);

            try
            {
                _factory.SetViewParameters(null, TestViewSupport.ToExprListMD(new Object[] { true, "Price" }));
                _factory.Attach(parentType, SupportStatementContextFactory.MakeContext(), null, null);
                Assert.Fail();
            }
            catch (ViewParameterException)
            {
                // expected;
            }
        }
Exemple #24
0
        public void TestAttaches()
        {
            // Should attach to anything as long as the fields exists
            EventType parentType = SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean));

            _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(new Object[] { "Price", "Volume" }));
            _factory.Attach(parentType, SupportStatementContextFactory.MakeContext(), null, null);
            Assert.AreEqual(typeof(double?), _factory.EventType.GetPropertyType(ViewFieldEnum.WEIGHTED_AVERAGE__AVERAGE.GetName()));

            try
            {
                _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(new Object[] { "Symbol", "Feed" }));
                _factory.Attach(parentType, SupportStatementContextFactory.MakeContext(), null, null);
                Assert.Fail();
            }
            catch (ViewParameterException ex)
            {
                // expected;
            }
        }
        public void TestAttaches()
        {
            // Should attach to anything as long as the fields exists
            EventType parentType = SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean));

            _factory.SetViewParameters(_viewFactoryContext,
                                       new[] { SupportExprNodeFactory.MakeIdentNodeMD("Volume"), SupportExprNodeFactory.MakeIdentNodeMD("Price") });
            _factory.Attach(parentType, SupportStatementContextFactory.MakeContext(_container), null, null);
            Assert.AreEqual(typeof(double?), _factory.EventType.GetPropertyType(ViewFieldEnum.REGRESSION__SLOPE.GetName()));

            try
            {
                _factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListMD(new Object[] { "Symbol", "Symbol" }));
                _factory.Attach(parentType, SupportStatementContextFactory.MakeContext(_container), null, null);
                Assert.Fail();
            }
            catch (ViewParameterException)
            {
                // expected;
            }
        }
Exemple #26
0
        public void TestCanReuse()
        {
            EventType            parentType           = SupportEventTypeFactory.CreateBeanType(typeof(SupportBean));
            AgentInstanceContext agentInstanceContext = SupportStatementContextFactory.MakeAgentInstanceContext();

            _factory.SetViewParameters(SupportStatementContextFactory.MakeViewContext(), TestViewSupport.ToExprListBean(new Object[] { "LongBoxed", 1000 }));
            _factory.Attach(parentType, SupportStatementContextFactory.MakeContext(), null, null);
            Assert.IsFalse(_factory.CanReuse(new FirstElementView(null), agentInstanceContext));
            Assert.IsFalse(_factory.CanReuse(new ExternallyTimedWindowView(_factory, SupportExprNodeFactory.MakeIdentNodeBean("LongPrimitive"), null, new ExprTimePeriodEvalDeltaConstGivenDelta(1000), null, SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext()), agentInstanceContext));
            Assert.IsFalse(_factory.CanReuse(new ExternallyTimedWindowView(_factory, SupportExprNodeFactory.MakeIdentNodeBean("LongBoxed"), null, new ExprTimePeriodEvalDeltaConstGivenDelta(999), null, SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext()), agentInstanceContext));
            Assert.IsTrue(_factory.CanReuse(new ExternallyTimedWindowView(_factory, SupportExprNodeFactory.MakeIdentNodeBean("LongBoxed"), null, new ExprTimePeriodEvalDeltaConstGivenDelta(1000000), null, SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext()), agentInstanceContext));
        }
Exemple #27
0
        private void TryParameter(Object[] @params, String fieldName, long msec)
        {
            ExternallyTimedWindowViewFactory factory = new ExternallyTimedWindowViewFactory();

            factory.SetViewParameters(SupportStatementContextFactory.MakeViewContext(), TestViewSupport.ToExprListBean(@params));
            factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportBean)), SupportStatementContextFactory.MakeContext(), null, null);
            ExternallyTimedWindowView view = (ExternallyTimedWindowView)factory.MakeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext());

            Assert.AreEqual(fieldName, view.TimestampExpression.ToExpressionStringMinPrecedenceSafe());
            Assert.IsTrue(new ExprTimePeriodEvalDeltaConstGivenDelta(msec).EqualsTimePeriod(view.TimeDeltaComputation));
        }
Exemple #28
0
        public void TestCanReuse()
        {
            AgentInstanceContext agentInstanceContext = SupportStatementContextFactory.MakeAgentInstanceContext();

            _factory.SetViewParameters(new ViewFactoryContext(null, 1, null, null, false, -1, false), TestViewSupport.ToExprListMD(new object[] { "Price", "Volume" }));
            _factory.Attach(SupportEventTypeFactory.CreateBeanType(typeof(SupportMarketDataBean)), SupportStatementContextFactory.MakeContext(), null, null);
            Assert.IsFalse(_factory.CanReuse(new FirstElementView(null), agentInstanceContext));
            EventType type = CorrelationView.CreateEventType(SupportStatementContextFactory.MakeContext(), null, 1);

            Assert.IsFalse(_factory.CanReuse(new CorrelationView(null, SupportStatementContextFactory.MakeAgentInstanceContext(), SupportExprNodeFactory.MakeIdentNodeMD("Volume"), SupportExprNodeFactory.MakeIdentNodeMD("Price"), type, null), agentInstanceContext));
            Assert.IsFalse(_factory.CanReuse(new CorrelationView(null, SupportStatementContextFactory.MakeAgentInstanceContext(), SupportExprNodeFactory.MakeIdentNodeMD("Feed"), SupportExprNodeFactory.MakeIdentNodeMD("Volume"), type, null), agentInstanceContext));
            Assert.IsTrue(_factory.CanReuse(new CorrelationView(null, SupportStatementContextFactory.MakeAgentInstanceContext(), SupportExprNodeFactory.MakeIdentNodeMD("Price"), SupportExprNodeFactory.MakeIdentNodeMD("Volume"), type, null), agentInstanceContext));
        }
        private void TryParameter(Object[] param)
        {
            LastElementViewFactory factory = new LastElementViewFactory();

            factory.SetViewParameters(SupportStatementContextFactory.MakeViewContext(), TestViewSupport.ToExprListBean(param));
            Assert.IsTrue(factory.MakeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext()) is LastElementView);
        }
 private void TryInvalidParameter(Object param)
 {
     try
     {
         LastElementViewFactory factory = new LastElementViewFactory();
         factory.SetViewParameters(SupportStatementContextFactory.MakeViewContext(), TestViewSupport.ToExprListBean(new Object[] { param }));
         Assert.Fail();
     }
     catch (ViewParameterException ex)
     {
         // expected
     }
 }