コード
Assert.AreEqual (9.97320998018748d, observerPosition.CenterLongitude);
生産する
Expected Value & Actual Value : 9.97320998018748
Remark : Both values look the same when formatted but they
are distinct instances.
MbUnit 3.0 で 2 つの double が等しいかどうかを比較する最もエレガントな方法は何ですか? 私はそれらを自分で切り上げることができることを知っていますが、これのための MbUnit コンストラクトはありますか?
更新:現在の「回避策」はエレガントではないと考えています:
Assert.LessThan(
Math.Abs(9.97320998018748d - observerPosition.CenterLongitude),
0.0000001);