What does Debug.assert() do?
-
takes Boolean condition as parameter and shows error dialog if condition is true; but proceeds without interruption if condition is false.
-
takes Boolean condition as parameter and throws exception if condition is false; but proceeds without interruption if condition is true.
-
takes Boolean condition as parameter and shows error dialog if condition is false; but proceeds without interruption if condition is true.
-
None of above
Debug.Assert checks a condition and shows an error dialog only when the condition is false (indicating a failure). When the condition is true (normal case), execution continues uninterrupted. The dialog helps catch logic errors during development.
Debug.assert() takes a Boolean condition and is meant to verify an assumption during development: if the condition evaluates to false, it signals a problem (traditionally by showing an error/alert), but if the condition is true, execution simply continues uninterrupted. This matches how assertions work generally — they exist to catch cases that should never happen, not to halt on the expected/true case.