Example #1
0
        public void Does_only_return_valid_types()
        {
            var dateTime       = DateTime.Now;
            var dateTimeOffset = DateTimeOffset.Now;
            var item           = new TestItem3
            {
                Array          = new string[] { "1", "2", "3" },
                Bool           = true,
                Byte           = 0xFF,
                Char           = 'c',
                ComplexType    = new TestItem2(),
                DateTime       = dateTime,
                DateTimeOffset = dateTimeOffset,
                Decimal        = 6.66M,
                Double         = 3.33,
                Enum           = TestEnum.High,
                Float          = 2.22f,
                Guid           = Guid.NewGuid(),
                Int            = 6,
                Long           = 7,
                SByte          = 8,
                Short          = 9,
                SimpleType     = "myValue",
                TimeSpan       = TimeSpan.FromSeconds(6.66),
                UInt           = 10,
                ULong          = 11,
                UShort         = 12
            };

            var result = item.GetProperties();

            Assert.Equal(21, result.Count);
        }