Debug.Log Extensions
Documentation (1.1.9)

◆ Assert() [7/11]

static void Debug.Assert ( Expression< Func< bool >>  condition,
[NotNull] Expression< Action >  contextMethod 

Logs an error message to the Console if expression does not return true.

public void Divide(int dividend, int divisor) { Debug.Assert(()=>divisor != 0, ()=> Divide(dividend, divisor));

return (float) dividend / divisor; }

conditionBoolean expression you expect to return true. For example a lambda expression.
contextMethodExpression pointing to a method to which the assertion applies.