void CreateCondensationCenter() { Molecule mTo = CondensationCenter, mAttach; foreach (var angle in new double[] { Math.PI * 5 / 6, Math.PI, 3 * Math.PI / 2, 3 * Math.PI / 2, 11 * Math.PI / 6 }) { mAttach = new Molecule(this, Molecule.InitMoleculeType.Center); mAttach.Position = mTo.Position.PointOfAngle(Molecule.TETRAHEDRON_SITE, angle); Molecules.Add(mAttach); mAttach.TryToAttachDefinitely(mTo); mTo = mAttach; } }
public void TryToAttachDefinitelyTest(Molecule mTo, Molecule mAttach, int boundNr_expected, BoundType boudType_expected) { mAttach.TryToAttachDefinitely(mTo); Assert.AreEqual(boundNr_expected, mTo.GetBoundNr(mAttach)); Assert.AreEqual(boundNr_expected, mAttach.GetBoundNr(mTo)); Assert.AreEqual(boudType_expected, mAttach.BoundType); var poz_expected = mTo.BoundPosition(boundNr_expected); AssertExtensions.AreAlmostEqual(poz_expected, mAttach.Position); // Assert.AreEqual(tetraNr_expected, mAttach.Position.TetrahedronPart(mTo.Position)); }