Use Assert.Throws
on code where exception expected:
[Fact]
public void TestMethod1_Error_twoMathces()
{
var message = "some text";
var parser = new MessageTypeParser();
Assert.Throws<MessageTypeParserException>(() => parser.GetType(message));
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…