public void SetUp()
        {
            _streamOne = new SupportStreamImpl(typeof(SupportBean), 1);
            _streamTwo = new SupportStreamImpl(typeof(SupportBean_A), 1);

            _viewService = new ViewServiceImpl();

            AgentInstanceViewFactoryChainContext context = SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext();

            _viewOne   = _viewService.CreateViews(_streamOne, SupportViewSpecFactory.MakeFactoryListOne(_streamOne.EventType), context, false).FinalViewable;
            _viewTwo   = _viewService.CreateViews(_streamOne, SupportViewSpecFactory.MakeFactoryListTwo(_streamOne.EventType), context, false).FinalViewable;
            _viewThree = _viewService.CreateViews(_streamOne, SupportViewSpecFactory.MakeFactoryListThree(_streamOne.EventType), context, false).FinalViewable;
            _viewFour  = _viewService.CreateViews(_streamOne, SupportViewSpecFactory.MakeFactoryListFour(_streamOne.EventType), context, false).FinalViewable;
            _viewFive  = _viewService.CreateViews(_streamTwo, SupportViewSpecFactory.MakeFactoryListFive(_streamTwo.EventType), context, false).FinalViewable;
        }
        public void TestInstantiateChain()
        {
            SupportBeanClassView topView                 = new SupportBeanClassView(TEST_CLASS);
            IList <ViewFactory>  viewFactories           = SupportViewSpecFactory.MakeFactoryListOne(topView.EventType);
            AgentInstanceViewFactoryChainContext context = SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext();

            // Check correct views created
            IList <View> views = ViewServiceHelper.InstantiateChain(topView, viewFactories, context);

            Assert.AreEqual(3, views.Count);
            Assert.AreEqual(typeof(LengthWindowView), views[0].GetType());
            Assert.AreEqual(typeof(UnivariateStatisticsView), views[1].GetType());
            Assert.AreEqual(typeof(LastElementView), views[2].GetType());

            // Check that the context is set
            viewFactories = SupportViewSpecFactory.MakeFactoryListFive(topView.EventType);
            views         = ViewServiceHelper.InstantiateChain(topView, viewFactories, context);
            TimeWindowView timeWindow = (TimeWindowView)views[0];
        }