19package denoptim.molecularmodeling.zmatrix;
21import static org.junit.jupiter.api.Assertions.assertEquals;
22import static org.junit.jupiter.api.Assertions.assertFalse;
23import static org.junit.jupiter.api.Assertions.assertNotEquals;
24import static org.junit.jupiter.api.Assertions.assertTrue;
26import org.junit.jupiter.api.Test;
41 1.5, 109.47, 180.0, 0);
43 1.5, 109.47, 180.0, 0);
45 1.5, 109.47, 180.0, 0);
47 1.0, 109.47, 180.0, -1);
59 assertEquals(atom1, atom1);
60 assertEquals(atom1, atom2);
61 assertNotEquals(atom1,
null);
64 assertNotEquals(atom1, atom2);
68 assertNotEquals(atom1, atom2);
72 assertNotEquals(atom1, atom2);
76 assertNotEquals(atom1, atom2);
80 assertNotEquals(atom1, atom2);
84 assertNotEquals(atom1, atom2);
88 assertNotEquals(atom1, atom2);
92 assertNotEquals(atom1, atom2);
96 assertNotEquals(atom1, atom2);
100 assertNotEquals(atom1, atom2);
109 1.5, 109.47, 180.0, 0);
111 1.5, 109.47, 180.0, 0);
114 "Equal atoms should have same hash code");
127 null,
null,
null,
null);
129 null,
null,
null,
null);
131 null,
null,
null,
null);
138 assertTrue(bond1.
equals(bond2),
"Identical bonds should be equal");
139 assertTrue(bond1.
equals(bond3),
140 "Bonds with reversed atom order should be equal (undirected)");
141 assertFalse(bond1.
equals(bond4),
142 "Bonds with different atoms should not be equal");
143 assertTrue(bond1.
equals(bond1),
"Bond should equal itself");
144 assertFalse(bond1.
equals(
null),
"Bond should not equal null");
145 assertFalse(bond1.
equals(
"not a bond"),
"Bond should not equal different type");
154 null,
null,
null,
null);
156 null,
null,
null,
null);
162 "Bonds with reversed order should have same hash code");
Representation of an atom in the ZMatrix.
void setBondLength(Double bondLength)
Set the bond length.
void setId(int id)
Set the id of the atom.
void setChiralFlag(Integer chiralFlag)
Set the chiral flag.
void setBondRefAtom(ZMatrixAtom bondRefAtom)
Package-private setter for bond reference atom (used for cloning).
void setType(String type)
Set the type of the atom.
void setAngleValue(Double angleValue)
Set the angle value.
void setAngle2Value(Double angle2Value)
Set the angle2 value.
void setSymbol(String symbol)
Set the symbol of the atom.
void setAngle2RefAtom(ZMatrixAtom angle2RefAtom)
Package-private setter for angle2 reference atom (used for cloning).
void setAngleRefAtom(ZMatrixAtom angleRefAtom)
Package-private setter for angle reference atom (used for cloning).
Unit test for ZMatrixAtom.
void testZMatrixBondHashCode()
void testZMatrixBondEquals()
void testZMatrixAtomHashCode()
static ZMatrixAtom getTestZMatrixAtom()
Representation of a bond in the ZMatrix.