Exemple #1
0
    public static bool FilterOnMetadata(Type t, MyClassType classType)
    {
        var metadataAttribute =
            (MyMetadataAttribute)t.GetCustomAttributes(true)
            .SingleOrDefault(at => at is MyMetadataAttribute);

        if (metadataAttribute != null)
        {
            return(metadataAttribute.Type == classType);
        }
        return(false);
    }
Exemple #2
0
 protected override void OnSetUp()
 {
     expectedInput      = new MyClassType();
     expectedInputIndex = new MyClassType();
     expectedOutput     = new MyClassType();
 }
 public MyMetadataAttribute(MyClassType type)
 {
     Type = type;
 }