📅  最后修改于: 2022-03-11 14:58:45.253000             🧑  作者: Mango
[Test]
public void TestException()
{
Assert.Throws(Is.TypeOf()
.And.Message.EqualTo("message")
.And.Property("MyParam").EqualTo(42),
delegate { throw new MyException("message", 42); });
}