public void Log_Simple() { var options = ErrorReportingOptions.Create( EventTarget.ForLogging("pid", loggingClient: new ThrowingLoggingClient())); var consumer = new FakeConsumer(); IContextExceptionLogger logger = new ErrorReportingContextExceptionLogger( consumer, _service, _version, options, null); logger.Log(CreateException(), new EmptyContextWrapper()); ValidateSingleEntry(consumer, "", "", "", options); }
public void Log() { var eventTarget = EventTarget.ForProject("pid"); var options = ErrorReportingOptions.CreateInstance(); var consumer = new FakeConsumer(); IContextExceptionLogger logger = new ErrorReportingContextExceptionLogger( consumer, eventTarget, _serviceContext, options, null); logger.Log(CreateException(), new FakeContextWrapper()); ValidateSingleEntry(consumer, _method, _uri, _userAgent, options, eventTarget); }
public void Log_Compat() { var eventTarget = EventTarget.ForLogging("pid", loggingClient: new ThrowingLoggingClient()); var options = ErrorReportingOptions.Create(eventTarget); var consumer = new FakeConsumer(); IContextExceptionLogger logger = new ErrorReportingContextExceptionLogger( consumer, eventTarget, _serviceContext, options, null); logger.Log(CreateException(), new FakeContextWrapper()); ValidateSingleEntry(consumer, _method, _uri, _userAgent, options, eventTarget); }
public void Log_Simple() { var mockConsumer = new Mock <IConsumer <ReportedErrorEvent> >(); mockConsumer.Setup(c => c.Receive(IsContext("", "", "", 0))); IContextExceptionLogger logger = new ErrorReportingContextExceptionLogger(mockConsumer.Object, _service, _version); logger.Log(CreateException(), new EmptyContextWrapper()); mockConsumer.VerifyAll(); }
public void Log() { var mockConsumer = new Mock <IConsumer <ReportedErrorEvent> >(); mockConsumer.Setup(c => c.Receive(IsContext(_method, _uri, _userAgent, _statusCode))); IContextExceptionLogger logger = new ErrorReportingContextExceptionLogger(mockConsumer.Object, _service, _version); logger.Log(CreateException(), new FakeContextWrapper()); mockConsumer.VerifyAll(); }
public void Log_Simple() { var options = ErrorReportingOptions.Create( EventTarget.ForLogging("pid", loggingClient: new Mock <LoggingServiceV2Client>().Object)); var mockConsumer = new Mock <IConsumer <LogEntry> >(); mockConsumer.Setup(c => c.Receive(IsContext("", "", "", options))); IContextExceptionLogger logger = new ErrorReportingContextExceptionLogger( mockConsumer.Object, _service, _version, options); logger.Log(CreateException(), new EmptyContextWrapper()); mockConsumer.VerifyAll(); }