コード例 #1
0
 public async Task Check_EndSymbolMessageRecognizer(string endSymbols, string sendMessage, string expectedMessage)
 {
     foreach (var actEncoding in _encodings)
     {
         var testObject = new EndSymbolsMessageRecognizer(actEncoding, endSymbols);
         await GenericTestMethodAsync(testObject, actEncoding, sendMessage, expectedMessage);
     }
 }
コード例 #2
0
        public async Task Check_EndSymbolMessageRecognizer_Errors(string endSymbols, string sendMessage, Type expectedExceptionType)
        {
            foreach (var actEncoding in _encodings)
            {
                var anyException = false;
                try
                {
                    var testObject = new EndSymbolsMessageRecognizer(actEncoding, endSymbols);
                    await GenericTestMethodAsync(testObject, actEncoding, sendMessage, "");
                }
                catch (Exception e)
                {
                    anyException = true;
                    Assert.IsTrue(e.GetType() == expectedExceptionType, "Unexpected exception fired");
                }

                Assert.IsTrue(anyException, "No exception fired!");
            }
        }