public void Equals() { const decimal lhs = 5.64351M; var rhs = 5.64351M; Assert.That(_type.IsEqual(lhs, rhs), Is.True); // Test that two decimal fields that are equal except one has a higher precision than // the other one are returned as Equal by the DecimalType. rhs = 5.643510M; Assert.That(_type.IsEqual(lhs, rhs), Is.True); }
public void Equals() { decimal lhs = 5.64351M; decimal rhs = 5.64351M; DecimalType type = (DecimalType)NHibernateUtil.Decimal; Assert.IsTrue(type.IsEqual(lhs, rhs)); // Test that two decimal fields that are equal except one has a higher precision than // the other one are returned as Equal by the DecimalType. rhs = 5.643510M; Assert.IsTrue(type.IsEqual(lhs, rhs)); }
public void UnsavedValue() { DecimalType type = (DecimalType)NHibernateUtil.Decimal; object mappedValue = type.StringToObject("0"); Assert.AreEqual(0m, mappedValue); Assert.IsTrue(type.IsEqual(mappedValue, 0m), "'0' in the mapping file should have been converted to a 0m"); }