Example #1
0
        private (ILogger, Mock <IExternalScopeProvider>) LogMessage(Mock <ILogEventSender> eventSourceMock, int eventId = 0, [CallerMemberName] string suffix = "")
        {
            Mock <IExternalScopeProvider> scopeProvicedMock = new Mock <IExternalScopeProvider>();
            ILogger logger = new OmexLogger(eventSourceMock.Object, scopeProvicedMock.Object, GetLogCategory(suffix));

            logger.LogError(CreateEventId(eventId, suffix), GetLogMessage(suffix));

            return(logger, scopeProvicedMock);
        }
Example #2
0
        private static (ILogger, Mock <IExternalScopeProvider>) LogMessage(Mock <ILogEventSender> eventSourceMock, ILogEventReplayer?logEventReplayer = null, int eventId = 0, [CallerMemberName] string suffix = "")
        {
            Mock <IExternalScopeProvider> scopeProvicedMock = new Mock <IExternalScopeProvider>();
            ILogger logger = new OmexLogger(eventSourceMock.Object, scopeProvicedMock.Object, GetLogCategory(suffix), logEventReplayer);

            logger.LogError(CreateEventId(eventId, suffix), s_expectedPropagatedException, GetLogMessage(suffix));

            return(logger, scopeProvicedMock);
        }