public void Does_Not_Throw_Raising_DiagnosticGenerated_If_No_Handlers_Bound(string message) { using (var client = new SoulseekClient(options: null)) { ListenerHandler l = new ListenerHandler(client); var diagnostic = l.GetProperty <IDiagnosticFactory>("Diagnostic"); var ex = Record.Exception(() => diagnostic.Info(message)); Assert.Null(ex); } }
public void Raises_DiagnosticGenerated_On_Diagnostic(string message) { using (var client = new SoulseekClient(options: null)) { DiagnosticEventArgs args = default; ListenerHandler l = new ListenerHandler(client); l.DiagnosticGenerated += (sender, e) => args = e; var diagnostic = l.GetProperty <IDiagnosticFactory>("Diagnostic"); diagnostic.Info(message); Assert.Equal(message, args.Message); } }