如何断言 FsUnit 中的异常消息?来自 NUnit 的类似内容:
[<Test>]
let ShouldThrowExceptionAndLog() =
Assert.That
((fun () -> Calculator.Calculate "-1"),
Throws.Exception.With.Property("Message").EqualTo("Negatives not allowed: -1"))
编辑:我不关心异常本身,我想测试异常 MESSAGE。