コード例 #1
0
        public void TestGetObjMappingName_没有定义映射()
        {
            AttributeHelper helper = new AttributeHelper();
            string mappingName = helper.GetTypeMappingName(typeof(DataItem_MappingClass_NoneMapping));

            Assert.AreEqual("", mappingName);
        }
コード例 #2
0
        public void TestGetObjMappingName_定义多种特性()
        {
            AttributeHelper helper = new AttributeHelper();
            string mappingName = helper.GetTypeMappingName(typeof(DataItem_MappingClass_OtherToo));

            Assert.AreEqual("TestMappingName", mappingName);
        }
コード例 #3
0
        public void TestGetPropertyMappingName_定义多种特性()
        {
            AttributeHelper helper = new AttributeHelper();
            PropertyInfo property = typeof(DataItem_MappingProperty).GetProperty("MappingAll");
            string dataMappingName, listMappingName;
            helper.GetPropertyMappingName(property, out dataMappingName, out listMappingName);

            Assert.AreEqual("TestMappingAll", dataMappingName);
            Assert.IsTrue(string.IsNullOrEmpty(listMappingName));
        }