IsSimpleProperty() public static method

Check if the given System.Type represents a "simple" property, i.e. a primitive, a System.String, a System.Type, or a corresponding array.

Used to determine properties to check for a "simple" dependency-check.

public static IsSimpleProperty ( Type type ) : bool
type System.Type /// The to check. ///
return bool
Beispiel #1
0
        public void IsSimpleProperty()
        {
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(string)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(long)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(bool)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(int)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(float)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(ushort)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(double)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(ulong)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(char)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(uint)));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(string[])));
            Assert.IsTrue(ObjectUtils.IsSimpleProperty(typeof(Type)));

            Assert.IsFalse(ObjectUtils.IsSimpleProperty(typeof(TestObject)));
            Assert.IsFalse(ObjectUtils.IsSimpleProperty(typeof(IList[])));
        }