internal void ProcessExpectedLogs()
        {
            lock (_lock)
            {
                if (!m_NeedToProcessLogs || !ExpectedLogs.Any())
                {
                    return;
                }

                LogMatch expectedLog = null;
                foreach (var logEvent in AllLogs)
                {
                    if (!ExpectedLogs.Any())
                    {
                        break;
                    }
                    if (expectedLog == null && ExpectedLogs.Any())
                    {
                        expectedLog = ExpectedLogs.Peek();
                    }

                    if (expectedLog != null && expectedLog.Matches(logEvent))
                    {
                        ExpectedLogs.Dequeue();
                        logEvent.IsHandled = true;
                        if (FailingLogs.Any(expectedLog.Matches))
                        {
                            var failingLog = FailingLogs.First(expectedLog.Matches);
                            FailingLogs.Remove(failingLog);
                        }
                        expectedLog = null;
                    }
                }
                m_NeedToProcessLogs = false;
            }
        }
 internal bool AnyFailingLogs()
 {
     ProcessExpectedLogs();
     return(FailingLogs.Any());
 }
Пример #3
0
 public bool AnyFailingLogs()
 {
     ProcessExpectedLogs();
     return(FailingLogs.Any());
 }