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

            // Act

            // Assert
            NullType.FindPropertiesWithAttributeOfType <ReflectionTestAttribute>(false).Should().BeEmpty();
            NullType.FindPropertiesWithAttributeOfType(typeof(ReflectionTestAttribute), false).Should().BeEmpty();
            NullType.FindPropertiesWithAttributeOfType <ReflectionTestAttribute>(false, BindingFlags.Instance | BindingFlags.NonPublic)
            .Should()
            .BeEmpty();

            NullType.FindPropertiesWithAttributeOfType(typeof(ReflectionTestAttribute), false, BindingFlags.Instance | BindingFlags.NonPublic)
            .Should()
            .BeEmpty();

            TestType.FindPropertiesWithAttributeOfType <ReflectionTestAttribute>(false).Should().HaveCount(3);
            TestType.FindPropertiesWithAttributeOfType(typeof(ReflectionTestAttribute), false).Should().HaveCount(3);

            TestType.FindPropertiesWithAttributeOfType <ReflectionTestAttribute>(false, BindingFlags.Instance | BindingFlags.NonPublic)
            .Should()
            .HaveCount(3);

            TestType.FindPropertiesWithAttributeOfType(typeof(ReflectionTestAttribute), false, BindingFlags.Instance | BindingFlags.NonPublic)
            .Should()
            .HaveCount(3);
        }