Skip to content

Remove Inline Assertion

Michael Damatov edited this page Jan 17, 2024 · 3 revisions

Suggests removing inline assertions

Remove invocation of the inline assertion method. Such a method is determined when all the conditions are met:

  • the method name starts with "AssertNotNull"
  • the method is an extension method
  • the method has single parameter
  • the method's parameter type equals to the return value type
  • the method is annotated with the [NotNull]
  • the method is annotated with the [DebuggerStepThrough]