Test if a class has an attribute?

前端 未结 4 611
再見小時候
再見小時候 2020-12-05 03:52

I\'m trying to do a little Test-First development, and I\'m trying to verify that my classes are marked with an attribute:

[SubControllerActionToViewDataAttr         


        
4条回答
  •  一整个雨季
    2020-12-05 04:12

    I know this thread is really old, but if somebody stumble upon on it you may find fluentassertions project very convenient for doing this kind of assertions.

    typeof(MyPresentationModel).Should().BeDecoratedWith();
    

提交回复
热议问题