public void ThreadSafeDouble_Overrides() { var tsdouble = new ThreadSafeDouble(9.15); var equaltsdouble = new ThreadSafeDouble(9.15); var notequaltsdouble = new ThreadSafeDouble(10.11); Assert.Equal("9.15", tsdouble.ToString()); Assert.True(tsdouble.Equals(equaltsdouble)); Assert.False(tsdouble.Equals(notequaltsdouble)); Assert.False(tsdouble.Equals(null)); Assert.True(tsdouble.Equals(9.15)); Assert.False(tsdouble.Equals(10.11)); Assert.Equal(9.15.GetHashCode(), tsdouble.GetHashCode()); }
public void ThreadSafeDouble_Overrides() { var tsdouble = new ThreadSafeDouble(9.15); var equaltsdouble = new ThreadSafeDouble(9.15); var notequaltsdouble = new ThreadSafeDouble(10.11); Assert.AreEqual(9.15.ToString(CultureInfo.CurrentCulture), tsdouble.ToString()); Assert.IsTrue(tsdouble.Equals(equaltsdouble)); Assert.IsFalse(tsdouble.Equals(notequaltsdouble)); Assert.IsFalse(tsdouble.Equals(null)); Assert.IsTrue(tsdouble.Equals(9.15)); Assert.IsFalse(tsdouble.Equals(10.11)); Assert.AreEqual((9.15).GetHashCode(), tsdouble.GetHashCode()); }