public void testHashCodesAreEqual() { FieldFormat ff1 = FieldFormat.create("<value><E><A=0.0>"); FieldFormat ff2 = FieldFormat.create("<value><E><A=0.0>"); Assert.AreEqual(ff1.getDefaultValue().GetHashCode(), ff2.getDefaultValue().GetHashCode()); //Assert.AreEqual(ff1.description == null) ? 0 : description.GetHashCode()); //Assert.AreEqual(ff1.editor == null) ? 0 : editor.GetHashCode()); //Assert.AreEqual(ff1.editorOptions == null) ? 0 : editorOptions.GetHashCode()); //Assert.AreEqual(ff1.getIcon().GetHashCode(), ); //result = prime * result + ((group == null) ? 0 : group.GetHashCode()); //result = prime * result + (extendableSelectionValues ? 1231 : 1237); //result = prime * result + ((help == null) ? 0 : help.GetHashCode()); //result = prime * result + (hidden ? 1231 : 1237); //result = prime * result + (inlineData ? 1231 : 1237); //result = prime * result + (keyField ? 1231 : 1237); //result = prime * result + ((name == null) ? 0 : name.GetHashCode()); //result = prime * result + (notReplicated ? 1231 : 1237); //result = prime * result + (nullable ? 1231 : 1237); //result = prime * result + (optional ? 1231 : 1237); //// result = prime * result + (readonly ? 1231 : 1237); //// result = prime * result + (advanced ? 1231 : 1237); //Assert.AreEqual(ff1.getSelectionValues().GetHashCode(), ff2.getSelectionValues().GetHashCode()); //result = prime * result + (transferEncode ? 1231 : 1237); Assert.AreEqual(ff1.getValidators().GetHashCode(), ff2.getValidators().GetHashCode()); Assert.AreEqual(ff1.GetHashCode(), ff2.GetHashCode()); }
public void testDefaultValue() { FieldFormat ff1 = FieldFormat.create("<s1><F><A=123.456>"); Assert.IsTrue(Math.Abs(123.456f - (float)ff1.getDefaultValue()) < 0.0000000000001f); }