Elegant Way to Verify That Method Throws Exception in .NET
From time to time, we face a situation when we need to define a variable that points to a method or an anonymous function. It could be a part of business logic or some test case from unit tests. C# has a particular type that allows pointing to a specific method with a particular list of parameters and return type. Instead of defining a new delegate type, C # contains build-in generic delegates such as Action and Func.