public void TestBondPermutation() { AtomContainer ac = new AtomContainer(); AtomContainer result; string bonds = ""; ac.Atoms.Add(new Atom("C")); ac.Atoms.Add(new Atom("N")); ac.Atoms.Add(new Atom("P")); ac.Atoms.Add(new Atom("O")); ac.Atoms.Add(new Atom("S")); ac.Atoms.Add(new Atom("Br")); ac.AddBond(ac.Atoms[0], ac.Atoms[1], BondOrder.Single); ac.AddBond(ac.Atoms[1], ac.Atoms[2], BondOrder.Double); ac.AddBond(ac.Atoms[2], ac.Atoms[3], BondOrder.Triple); ac.AddBond(ac.Atoms[3], ac.Atoms[4], BondOrder.Quadruple); ac.AddBond(ac.Atoms[4], ac.Atoms[5], BondOrder.Single); // was 5.0 ! AtomContainerBondPermutor acap = new AtomContainerBondPermutor(ac); int counter = 0; while (acap.MoveNext()) { counter++; bonds = ""; result = (AtomContainer)acap.Current; for (int f = 0; f < result.Bonds.Count; f++) { bonds += result.Bonds[f].Order; } //Debug.WriteLine(bonds); } Assert.AreEqual(119, counter); }
public void Main() { var container = TestMoleculeFactory.MakeBenzene(); #region AtomContainerBondPermutor permutor = new AtomContainerBondPermutor(container); while (permutor.MoveNext()) { IAtomContainer permutedContainer = permutor.Current; // ... } #endregion }
public void TestBondPermutation() { AtomContainer ac = new AtomContainer(); ac.Atoms.Add(new Atom("C")); ac.Atoms.Add(new Atom("N")); ac.Atoms.Add(new Atom("P")); ac.Atoms.Add(new Atom("O")); ac.Atoms.Add(new Atom("S")); ac.Atoms.Add(new Atom("Br")); ac.AddBond(ac.Atoms[0], ac.Atoms[1], BondOrder.Single); ac.AddBond(ac.Atoms[1], ac.Atoms[2], BondOrder.Double); ac.AddBond(ac.Atoms[2], ac.Atoms[3], BondOrder.Triple); ac.AddBond(ac.Atoms[3], ac.Atoms[4], BondOrder.Quadruple); ac.AddBond(ac.Atoms[4], ac.Atoms[5], BondOrder.Single); // was 5.0 ! AtomContainerBondPermutor acap = new AtomContainerBondPermutor(ac); int counter = 0; while (acap.MoveNext()) { counter++; } Assert.AreEqual(119, counter); }