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));
        }
        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());
        }
 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(), null, null);
         Assert.Fail();
     }
     catch (ViewParameterException ex)
     {
         // expected
     }
 }