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); } }
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!"); } }