上下文
在XUnit github中我发现了这个:添加Assert.Equal(预期,实际,消息)重载#350 (所以开发人员要求不存在的重载请参见下文)
引用答案:
我们相信自我记录的代码; 包括你的断言.
(所以XUnit团队拒绝它)
好,我知道了.我也相信自我记录代码.我还是找不到这个用例:
样品
// Arrange
// Create some external soap service client and its wrapper classes
// Act
// client.SomeMethod();
// Assert
// Sorry, soap service's interface, behaviour and design is *given*
// So I have to check if there is no Error, and
// conveniently if there is, then I would like to see it in the assertion message
Assert.Equal(0, client.ErrorMessage.Length); // Means no error
// I would like to have …Run Code Online (Sandbox Code Playgroud)