コード例 #1
0
ファイル: Method.cs プロジェクト: tchrikch/tdd-toolkit
        public bool HasAttribute(Type attributeType, Attribute expectedAttribute)
        {
            var attrs = Attribute.GetCustomAttributes(_methodInfo, attributeType);
            var any   = attrs.Any(
                currentAttribute => Are.Alike(expectedAttribute, currentAttribute)
                );

            return(any);
        }
コード例 #2
0
ファイル: Method.cs プロジェクト: tchrikch/tdd-toolkit
        public bool HasAttribute <T>(T expectedAttribute) where T : Attribute
        {
            var attrs = Attribute.GetCustomAttributes(_methodInfo, typeof(T));
            var any   = attrs.Any(
                currentAttribute => Are.Alike(expectedAttribute, currentAttribute)
                );

            return(any);
        }
コード例 #3
0
 public static T IsLike <T>(T expected)
 {
     return(Arg.Is <T>(arg => Are.Alike(expected, arg)));
 }