c# - How to build a new NUnit constraint -


I have an extension extension that gives a given value to one of the values ​​in the list.

  Public stable zero IsEither & lt; T & gt; (This T value, parameter T [] permitted value) {EqualConstraint isInAllowed = null; Foreign currency (allowed in allowed value) isInAllowed = isInAllowed == Faucet? Is.EqualTo (allowed): isInAllowed.Or.EqualTo (allowed); Responsibility That (value, is in). }   

I am surprised that there is no other better / elegant way to do this, especially NUINT restriction makers, restrictions, expeditions, restriction operators, etc.

NUnit has a collection shape that should help. If you are stressing that there is one more item in the collection of items, then you can try to do something like this:

  Public static zero IsEither & lt; T & gt; (This T value, parameter T [] permitted value) {CollectionAssort.Customized (acceptable value, value); }    

Comments