代码
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)