def METHOD_NAME(aggregator, dd_run_check, instance):
    with patch("datadog_checks.unifi_console.check.Unifi.status") as mock_status:
        check = UnifiConsoleCheck("unifi", {}, [instance])
        mock_status.side_effect = Exception()
        with pytest.raises(Exception):
            dd_run_check(check)
        aggregator.assert_service_check("unifi_console.can_connect", AgentCheck.CRITICAL, tags=check._config.tags)
        aggregator.assert_service_check("unifi_console.healthy", AgentCheck.CRITICAL, tags=check._config.tags)
        aggregator.assert_metric('unifi_console.healthy', 0, metric_type=aggregator.GAUGE)