public void With_default_options_all_types_match_requirements()
 {
     Assert.That(_attribute.MatchesRequirements(typeof(IExampleInterface)), Is.True);
     Assert.That(_attribute.MatchesRequirements(typeof(StructExample)), Is.True);
     Assert.That(_attribute.MatchesRequirements(typeof(AbstractClass)), Is.True);
     Assert.That(_attribute.MatchesRequirements(typeof(NormalClass)), Is.True);
 }
Ejemplo n.º 2
0
        private static bool FilterConstraintIsSatisfied(TypeOptionsAttribute filter, Type type)
        {
            if (filter == null)
            {
                return(true);
            }

            return(filter.MatchesRequirements(type));
        }