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); }
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); }
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[] parameters) { try { var factory = new GroupByViewFactory(); factory.SetViewParameters(_viewFactoryContext, TestViewSupport.ToExprListBean(parameters)); factory.Attach( SupportEventTypeFactory.CreateBeanType(typeof(SupportBean)), SupportStatementContextFactory.MakeContext(_container), null, null); Assert.Fail(); } catch (ViewParameterException) { // expected } }