public void IsLanguageWorkerConsoleLog_Returns_True_RemovesLogPrefix(string msg) { LanguageWorkerChannel languageWorkerChannel = new LanguageWorkerChannel(); Assert.True(LanguageWorkerChannelUtilities.IsLanguageWorkerConsoleLog(msg)); Assert.Equal(" Connection established", LanguageWorkerChannelUtilities.RemoveLogPrefix(msg)); }
public void ErrorMessageQueue_Enqueue_Success() { LanguageWorkerChannelUtilities.AddStdErrMessage(_languageWorkerProcess.ProcessStdErrDataQueue, "Error1"); LanguageWorkerChannelUtilities.AddStdErrMessage(_languageWorkerProcess.ProcessStdErrDataQueue, "Error2"); Assert.True(_languageWorkerProcess.ProcessStdErrDataQueue.Count == 2); string exceptionMessage = string.Join(",", _languageWorkerProcess.ProcessStdErrDataQueue.Where(s => !string.IsNullOrEmpty(s))); Assert.Equal("Error1,Error2", exceptionMessage); }
public void ErrorMessageQueue_Full_Enqueue_Success() { LanguageWorkerChannel languageWorkerChannel = new LanguageWorkerChannel(); LanguageWorkerChannelUtilities.AddStdErrMessage(languageWorkerChannel.ProcessStdErrDataQueue, "Error1"); LanguageWorkerChannelUtilities.AddStdErrMessage(languageWorkerChannel.ProcessStdErrDataQueue, "Error2"); LanguageWorkerChannelUtilities.AddStdErrMessage(languageWorkerChannel.ProcessStdErrDataQueue, "Error3"); LanguageWorkerChannelUtilities.AddStdErrMessage(languageWorkerChannel.ProcessStdErrDataQueue, "Error4"); Assert.True(languageWorkerChannel.ProcessStdErrDataQueue.Count == 3); string exceptionMessage = string.Join(",", languageWorkerChannel.ProcessStdErrDataQueue.Where(s => !string.IsNullOrEmpty(s))); Assert.Equal("Error2,Error3,Error4", exceptionMessage); }
public void IsLanguageWorkerConsoleLog_Returns_False(string msg) { Assert.False(LanguageWorkerChannelUtilities.IsLanguageWorkerConsoleLog(msg)); }