Quantcast
Viewing all articles
Browse latest Browse all 1402

New Post: Testing Arguments of Attributes

The simplest form I can think of is:

typeof(OutputClassifierProvider).Should().BeDecoratedWith<ContentTypeAttribute>("output")

Another form might be:

typeof(OutputClassifierProvider).Should().BeDecoratedWith<ContentTypeAttribute>().WithArg("output")

Or:

typeof(OutputClassifierProvider).Should().BeDecoratedWith<ContentTypeAttribute>().WithArgs(new object[] {"output"})

Where WithArgs takes an object array. I don't write fluent interfaces very often but know they're difficult to get right and implement.


Viewing all articles
Browse latest Browse all 1402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>