代码
Assert.AreEqual (9.97320998018748d, observerPosition.CenterLongitude);
Run Code Online (Sandbox Code Playgroud)
产生
Expected Value & Actual Value : 9.97320998018748
Remark : Both values look the same when formatted but they
are distinct instances.
Run Code Online (Sandbox Code Playgroud)
在MbUnit 3.0中比较两个双打同等的最优雅的方法是什么?我知道我可以自己围绕它们,但是有一些MbUnit构造吗?
更新:我认为我目前的"解决方法"不优雅:
Assert.LessThan(
Math.Abs(9.97320998018748d - observerPosition.CenterLongitude),
0.0000001);
Run Code Online (Sandbox Code Playgroud)
AreApproximatelyEqual 似乎是"MbUnit构造的":
验证实际值是否大约等于指定增量内的某个预期值.
这似乎与之相似 Assert.AreEqual(double expected, double actual, double delta)
| 归档时间: |
|
| 查看次数: |
599 次 |
| 最近记录: |