Exemplo n.º 1
0
 public async Task Check_ByUnderlyingPackageMessageRecognizer(string sendMessage, string expectedMessage)
 {
     foreach (var actEncoding in _encodings)
     {
         var testObject = new ByUnderlyingPackageMessageRecognizer(actEncoding);
         await GenericTestMethodAsync(testObject, actEncoding, sendMessage, expectedMessage);
     }
 }
Exemplo n.º 2
0
        public async Task Check_ByUnderlyingPackageMessageRecognizer_Errors(string sendMessage, Type expectedExceptionType)
        {
            foreach (var actEncoding in _encodings)
            {
                var anyException = false;
                try
                {
                    var testObject = new ByUnderlyingPackageMessageRecognizer(actEncoding);
                    await GenericTestMethodAsync(testObject, actEncoding, sendMessage, "");
                }
                catch (Exception e)
                {
                    anyException = true;
                    Assert.IsTrue(e.GetType() == expectedExceptionType, "Unexpected exception fired");
                }

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