public void TestGetBondCount() { IAtomContainer mol = TestMoleculeFactory.MakeAdenine(); AllRingsFinder arf = new AllRingsFinder(); IRingSet ringSet = arf.FindAllRings(mol); Assert.AreEqual(3, ringSet.Count); Assert.AreEqual(20, RingSetManipulator.GetBondCount(ringSet)); mol = TestMoleculeFactory.MakeBiphenyl(); ringSet = arf.FindAllRings(mol); Assert.AreEqual(2, ringSet.Count); Assert.AreEqual(12, RingSetManipulator.GetBondCount(ringSet)); }
public void TestGetAtomCount_IRingSet() { IRingSet rs = builder.NewRingSet(); IRing ac1 = builder.NewRing(); ac1.Atoms.Add(builder.NewAtom("O")); rs.Add(ac1); IRing ac2 = builder.NewRing(); ac2.Atoms.Add(builder.NewAtom("C")); ac2.Atoms.Add(builder.NewAtom("C")); ac2.AddBond(ac2.Atoms[0], ac2.Atoms[1], BondOrder.Double); rs.Add(ac2); Assert.AreEqual(3, RingSetManipulator.GetAtomCount(rs)); Assert.AreEqual(1, RingSetManipulator.GetBondCount(rs)); }