public void Parse_ValidMessage_ParsesSyslogMessage(SampleMessage testCase) { var target = new RegexSyslogMessageParser(); var actualMessage = target.Parse(testCase.GetMessageBytes()); AssertEqual(testCase.ExpectedMessage, actualMessage); }
public void Parse_InvalidMessage_ThrowsException() { var target = new RegexSyslogMessageParser(); Assert.Throws <InvalidOperationException>(() => target.Parse(Encoding.UTF8.GetBytes("Not a valid message"))); }