We are inundated with false "possible System.NullReferenceException" warnings
because ReSharper code inspection has no way to determine that our assert
method is preventing invalid use of null.
Here's a sample assert we use to simplify and clarify method parameter checking.
There are other overloads as you'd expect:
static class Guard
public static void AgainstNull(T
value)" methods to return "value", and then do
arg1 = Guard.AgainstNull(arg1, "arg1")
but that has too much code smell.
EdHow do I get ReSharper Code Inspection to recognize our assert method is
preventing a possible System.NullReferenceException?