Пример #1
0
        public void FindPropertiesOfType()
        {
            // Arrange

            // Act

            // Assert
            NullType.FindPropertiesOfType <string>().Should().BeEmpty();
            NullType.FindPropertiesOfType(typeof(string)).Should().BeEmpty();
            NullType.FindPropertiesOfType <string>(BindingFlags.NonPublic).Should().BeEmpty();
            NullType.FindPropertiesOfType(typeof(string), BindingFlags.NonPublic).Should().BeEmpty();

            TestType.FindPropertiesOfType <string>().Should().HaveCount(2);
            TestType.FindPropertiesOfType(typeof(string)).Should().HaveCount(2);
            TestType.FindPropertiesOfType <string>(BindingFlags.Instance | BindingFlags.NonPublic).Should().HaveCount(3);
            TestType.FindPropertiesOfType(typeof(string), BindingFlags.Instance | BindingFlags.NonPublic).Should().HaveCount(3);

            TestType.FindPropertiesOfType <Gender>().Should().HaveCount(1);
            TestType.FindPropertiesOfType(typeof(Gender)).Should().HaveCount(1);
            TestType.FindPropertiesOfType <Gender>(BindingFlags.Instance | BindingFlags.NonPublic).Should().HaveCount(0);
            TestType.FindPropertiesOfType(typeof(Gender), BindingFlags.Instance | BindingFlags.NonPublic).Should().HaveCount(0);
        }