public void TestGetNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour_IAtomContainer() { AtomPlacer3D atmplacer = new AtomPlacer3D(); IAtomContainer cyclobutane = TestMoleculeFactory.MakeCyclobutane(); IAtomContainer acyclicAlkane = TestMoleculeFactory.MakeAlkane(6); foreach (var atom in cyclobutane.Atoms) { atom.IsInRing = true; } foreach (var atom in acyclicAlkane.Atoms) { atom.IsAliphatic = true; } for (int j = 0; j < 3; j++) { cyclobutane.Atoms[j].IsPlaced = true; } IAtom nextHeavyAtom = atmplacer.GetNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour(cyclobutane); Assert.IsNull(nextHeavyAtom); foreach (var atom in cyclobutane.Atoms) { if (!atom.IsPlaced) { atom.IsPlaced = true; } } IAtom nextHeavyAtom2 = atmplacer.GetNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour(cyclobutane); Assert.IsNull(nextHeavyAtom2); for (int k = 0; k < 3; k++) { acyclicAlkane.Atoms[k].IsPlaced = true; } IAtom nextSuchUnplacedHeavyAtom = atmplacer.GetNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour(acyclicAlkane); Assert.AreEqual(acyclicAlkane.Atoms[3], nextSuchUnplacedHeavyAtom); foreach (var atom in acyclicAlkane.Atoms) { atom.IsPlaced = true; } nextSuchUnplacedHeavyAtom = atmplacer.GetNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour(acyclicAlkane); Assert.IsNull(nextSuchUnplacedHeavyAtom); }