static NonLinearTransformFunctionTest() { NULL_TRANSFORMS = new ParameterLimitsTransform[2]; NULL_TRANSFORMS[0] = new NullTransform(); NULL_TRANSFORMS[1] = new NullTransform(); TRANSFORMS = new ParameterLimitsTransform[2]; TRANSFORMS[0] = new DoubleRangeLimitTransform(0, Math.PI); TRANSFORMS[1] = new SingleRangeLimitTransform(0, ParameterLimitsTransform_LimitType.GREATER_THAN); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testHashCodeAndEquals() public virtual void testHashCodeAndEquals() { ParameterLimitsTransform other = new DoubleRangeLimitTransform(A, B); assertEquals(other, RANGE_LIMITS); assertEquals(other.GetHashCode(), RANGE_LIMITS.GetHashCode()); other = new DoubleRangeLimitTransform(A - 1, B); assertFalse(other.Equals(RANGE_LIMITS)); other = new DoubleRangeLimitTransform(A, B + 1); assertFalse(other.Equals(RANGE_LIMITS)); }
public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (this.GetType() != obj.GetType()) { return(false); } DoubleRangeLimitTransform other = (DoubleRangeLimitTransform)obj; if (System.BitConverter.DoubleToInt64Bits(_lower) != Double.doubleToLongBits(other._lower)) { return(false); } return(System.BitConverter.DoubleToInt64Bits(_upper) == Double.doubleToLongBits(other._upper)); }