Esempio n. 1
0
        private void TryInvalidField(string fieldName, Type clazz)
        {
            ConfigurationCommonEventTypeBean config = new ConfigurationCommonEventTypeBean();

            config.AddFieldProperty("name", fieldName);
            builder = new PropertyListBuilderExplicit(config);

            try
            {
                builder.AssessProperties(clazz);
            }
            catch (ConfigurationException ex)
            {
                // expected
                log.Debug(ex.Message);
            }
        }
Esempio n. 2
0
        public void TestBuildPropList()
        {
            IList <PropertyStem> descList = builder.AssessProperties(typeof(SupportLegacyBean));

            IList <PropertyStem> expected = new List <PropertyStem>();

            expected.Add(new PropertyStem("f_legVal", typeof(SupportLegacyBean).GetField("fieldLegacyVal"), PropertyType.SIMPLE | PropertyType.INDEXED));
            expected.Add(new PropertyStem("f_strArr", typeof(SupportLegacyBean).GetField("fieldStringArray"), PropertyType.SIMPLE | PropertyType.INDEXED));
            expected.Add(new PropertyStem("f_strMap", typeof(SupportLegacyBean).GetField("fieldMapped"), PropertyType.SIMPLE | PropertyType.MAPPED));
            expected.Add(new PropertyStem("f_legNested", typeof(SupportLegacyBean).GetField("fieldNested"), PropertyType.SIMPLE));

            expected.Add(new PropertyStem("m_legVal", typeof(SupportLegacyBean).GetMethod("ReadLegacyBeanVal"), PropertyType.SIMPLE | PropertyType.INDEXED));
            expected.Add(new PropertyStem("m_strArr", typeof(SupportLegacyBean).GetMethod("ReadStringArray"), PropertyType.SIMPLE | PropertyType.INDEXED));
            expected.Add(new PropertyStem("m_strInd", typeof(SupportLegacyBean).GetMethod("ReadStringIndexed", new Type[] { typeof(int) }), PropertyType.INDEXED));
            expected.Add(new PropertyStem("m_strMapKeyed", typeof(SupportLegacyBean).GetMethod("ReadMapByKey", new Type[] { typeof(string) }), PropertyType.MAPPED));
            expected.Add(new PropertyStem("m_strMap", typeof(SupportLegacyBean).GetMethod("ReadMap"), PropertyType.SIMPLE | PropertyType.MAPPED));
            expected.Add(new PropertyStem("m_legNested", typeof(SupportLegacyBean).GetMethod("ReadLegacyNested"), PropertyType.SIMPLE));

            CollectionAssert.AreEquivalent(expected, descList);
            //EPAssertionUtil.AssertEqualsAnyOrder(expected.ToArray(), descList.ToArray());
        }