コード例 #1
0
        public void IsLanguageWorkerConsoleLog_Returns_True_RemovesLogPrefix(string msg)
        {
            LanguageWorkerChannel languageWorkerChannel = new LanguageWorkerChannel();

            Assert.True(LanguageWorkerChannelUtilities.IsLanguageWorkerConsoleLog(msg));
            Assert.Equal(" Connection established", LanguageWorkerChannelUtilities.RemoveLogPrefix(msg));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public void IsLanguageWorkerConsoleLog_Returns_False(string msg)
 {
     Assert.False(LanguageWorkerChannelUtilities.IsLanguageWorkerConsoleLog(msg));
 }