public void SetUpReport() { var actionGuid = _report.RecordActivityStarted("take a rest", "couch"); _report.RecordEvent("went home", "car", "legs"); _report.RecordActivityFinished(actionGuid); _report.RecordError(new InvalidOperationException("It's Monday noon. Get up and work!")); }
private static void ReportAndProceed(IInvocation invocation, IEventReport report) { String actionGuid = report.RecordActivityStarted(FormatInvocationName(invocation), invocation.Arguments); try { invocation.Proceed(); } catch (Exception ex) { report.RecordError(ex); throw; } finally { if (!String.IsNullOrEmpty(actionGuid)) { report.RecordActivityFinished(actionGuid); } } }