What is the smoothest, most appealing syntax you've found for asserting parameter correctness in c#?

后端 未结 14 1910
一个人的身影
一个人的身影 2020-12-22 23:50

A common problem in any language is to assert that parameters sent in to a method meet your requirements, and if they don\'t, to send nice, informative error messages. This

14条回答
  •  一整个雨季
    2020-12-23 00:49

    Just as a contrast, this post by Miško Hevery on the Google Testing Blog argues that this kind of parameter checking might not always be a good thing. The resulting debate in the comments also raises some interesting points.

提交回复
热议问题