public void TestTripleBond() { var container = SMARTSParser.Parse("C#C"); Assert.AreEqual(2, container.Atoms.Count); Assert.AreEqual(1, container.Bonds.Count); IBond bond = container.Bonds[0]; Assert.IsTrue(bond is OrderQueryBond); OrderQueryBond qBond = (OrderQueryBond)bond; Assert.AreEqual(BondOrder.Triple, qBond.Order); }
public void TestDoubleBond() { var container = SMARTSParser.Parse("C=C", ChemObjectBuilder.Instance); Assert.AreEqual(2, container.Atoms.Count); Assert.AreEqual(1, container.Bonds.Count); IBond bond = container.Bonds[0]; Assert.IsTrue(bond is OrderQueryBond); OrderQueryBond qBond = (OrderQueryBond)bond; Assert.AreEqual(BondOrder.Double, qBond.Order); }
public void TestSFBug1708336() { var atomContainer = builder.NewAtomContainer(); atomContainer.Atoms.Add(builder.NewAtom("C")); atomContainer.Atoms.Add(builder.NewAtom("C")); atomContainer.Atoms.Add(builder.NewAtom("N")); atomContainer.AddBond(atomContainer.Atoms[0], atomContainer.Atoms[1], BondOrder.Single); atomContainer.AddBond(atomContainer.Atoms[1], atomContainer.Atoms[2], BondOrder.Single); var query = new QueryAtomContainer(); var a1 = new SymbolQueryAtom() { Symbol = "C" }; var a2 = new Isomorphisms.Matchers.SMARTS.AnyAtom(); var b1 = new OrderQueryBond(a1, a2, BondOrder.Single); var a3 = new SymbolQueryAtom() { Symbol = "C" }; var b2 = new OrderQueryBond(a2, a3, BondOrder.Single); query.Atoms.Add(a1); query.Atoms.Add(a2); query.Atoms.Add(a3); query.Bonds.Add(b1); query.Bonds.Add(b2); var list = CDKMCS.GetSubgraphMaps(atomContainer, query, true); Assert.IsTrue(list.Count == 0); }