コード例 #1
0
        public void GetEnumerator_WhenTheStructHasInstanceProperties_TheyAreReturned()
        {
            var propertyIterator = new SetInstancePropertyIterator<SetPropertyTestStruct>();

            string[] propertyNames = propertyIterator.Select(p => p.Name).OrderBy(p => p).ToArray();

            var expectedNames = new[] { "PropInt", "PropDouble", "PropAuto" }.OrderBy(p => p).ToArray();

            Assert.Equal(expectedNames, propertyNames);
        }
コード例 #2
0
        public void GetEnumerator_WhenTheClassHasInstanceProperties_TheyAreReturned()
        {
            var propertyIterator = new SetInstancePropertyIterator<SetPropertyTest>();

            string[] propertyNames = propertyIterator.Select(p => p.Name).OrderBy(p => p).ToArray();

            var expectedNames = new[] { "PropInt", "PropDouble", "PropByte", "PropShort", "PropString", "PropLong", "PropDecimal", "PropFloat", "PropAuto" }
               .OrderBy(p => p).ToArray();

            Assert.Equal(expectedNames.OrderBy(p => p), propertyNames.OrderBy(p => p));
        }