public async Task Check_FixedLengthWithEndSymbolMessageRecognizer(string endSymbols, int lengthIncludingEndSymbols, char fillSymbol, string sendMessage, string expectedMessage) { foreach (var actEncoding in _encodings) { var testObject = new FixedLengthAndEndSymbolsMessageRecognizer(actEncoding, endSymbols, lengthIncludingEndSymbols, fillSymbol); await GenericTestMethodAsync(testObject, actEncoding, sendMessage, expectedMessage); } }
public async Task Check_FixedLengthWithEndSymbolMessageRecognizer_Errors(string endSymbols, int lengthIncludingEndSymbols, char fillSymbol, string sendMessage, Type expectedExceptionType) { foreach (var actEncoding in _encodings) { var anyException = false; try { var testObject = new FixedLengthAndEndSymbolsMessageRecognizer(actEncoding, endSymbols, lengthIncludingEndSymbols, fillSymbol); await GenericTestMethodAsync(testObject, actEncoding, sendMessage, ""); } catch (Exception e) { anyException = true; Assert.IsTrue(e.GetType() == expectedExceptionType, "Unexpected exception fired"); } Assert.IsTrue(anyException, "No exception fired!"); } }