Пример #1
0
        public void When_IncludeBaseType_is_true_base_type_matches_requirements()
        {
            var attribute = new InheritsAttribute(typeof(IParentInterface))
            {
                IncludeBaseType = true
            };

            Assert.That(attribute.MatchesRequirements(typeof(IParentInterface)), Is.True);
        }
Пример #2
0
        public void When_abstract_class_is_base_type_and_IncludeBaseType_is_true_it_matches_requirements()
        {
            var attribute = new InheritsAttribute(typeof(ParentAbstractClass))
            {
                IncludeBaseType = true
            };

            Assert.That(attribute.MatchesRequirements(typeof(ParentAbstractClass)), Is.True);
        }
Пример #3
0
        public void When_interface_is_base_type_and_AllowAbstract_is_true_derived_interfaces_match_requirements()
        {
            var attribute = new InheritsAttribute(typeof(IParentInterface))
            {
                IncludeBaseType = true
            };

            Assert.That(attribute.MatchesRequirements(typeof(IChildInterface)), Is.False);
        }
Пример #4
0
        public void Abstract_classes_are_not_included_by_default()
        {
            var attribute = new InheritsAttribute(typeof(IParentInterface));

            Assert.That(attribute.MatchesRequirements(typeof(ParentAbstractClass)), Is.False);
        }
Пример #5
0
        public void Base_type_does_not_match_requirements_by_default()
        {
            var attribute = new InheritsAttribute(typeof(IParentInterface));

            Assert.That(attribute.MatchesRequirements(typeof(IParentInterface)), Is.False);
        }
Пример #6
0
        public void When_interface_is_base_type_a_struct_that_implements_it_matches_requirements()
        {
            var attribute = new InheritsAttribute(typeof(IParentInterface));

            Assert.That(attribute.MatchesRequirements(typeof(ChildStruct)), Is.True);
        }
Пример #7
0
        public void When_interface_is_base_type_derived_interfaces_do_not_match_requirements()
        {
            var attribute = new InheritsAttribute(typeof(IParentInterface));

            Assert.That(attribute.MatchesRequirements(typeof(IChildInterface)), Is.False);
        }