Beispiel #1
0
 public void CheckParameters(SignatureQuotientGraph qGraph, int expectedVertexCount, int expectedEdgeCount,
                             int expectedLoopEdgeCount)
 {
     Assert.AreEqual(expectedVertexCount, qGraph.GetVertexCount());
     Assert.AreEqual(expectedEdgeCount, qGraph.GetEdgeCount());
     Assert.AreEqual(expectedLoopEdgeCount, qGraph.NumberOfLoopEdges());
 }
Beispiel #2
0
        public void NapthaleneWithDoubleBondsAndHydrogenHeightTest()
        {
            IAtomContainer napthalene = builder.NewAtomContainer();

            for (int i = 0; i < 10; i++)
            {
                napthalene.Atoms.Add(builder.NewAtom("C"));
            }
            napthalene.AddBond(napthalene.Atoms[0], napthalene.Atoms[1], BondOrder.Single);
            napthalene.AddBond(napthalene.Atoms[0], napthalene.Atoms[5], BondOrder.Double);
            napthalene.AddBond(napthalene.Atoms[1], napthalene.Atoms[2], BondOrder.Double);
            napthalene.AddBond(napthalene.Atoms[1], napthalene.Atoms[6], BondOrder.Single);
            napthalene.AddBond(napthalene.Atoms[2], napthalene.Atoms[3], BondOrder.Single);
            napthalene.AddBond(napthalene.Atoms[2], napthalene.Atoms[9], BondOrder.Single);
            napthalene.AddBond(napthalene.Atoms[3], napthalene.Atoms[4], BondOrder.Double);
            napthalene.AddBond(napthalene.Atoms[4], napthalene.Atoms[5], BondOrder.Single);
            napthalene.AddBond(napthalene.Atoms[6], napthalene.Atoms[7], BondOrder.Double);
            napthalene.AddBond(napthalene.Atoms[7], napthalene.Atoms[8], BondOrder.Single);
            napthalene.AddBond(napthalene.Atoms[8], napthalene.Atoms[9], BondOrder.Double);

            napthalene.Atoms.Add(builder.NewAtom("H"));
            napthalene.AddBond(napthalene.Atoms[0], napthalene.Atoms[10], BondOrder.Single);
            napthalene.Atoms.Add(builder.NewAtom("H"));
            napthalene.AddBond(napthalene.Atoms[3], napthalene.Atoms[11], BondOrder.Single);
            napthalene.Atoms.Add(builder.NewAtom("H"));
            napthalene.AddBond(napthalene.Atoms[4], napthalene.Atoms[12], BondOrder.Single);
            napthalene.Atoms.Add(builder.NewAtom("H"));
            napthalene.AddBond(napthalene.Atoms[5], napthalene.Atoms[13], BondOrder.Single);
            napthalene.Atoms.Add(builder.NewAtom("H"));
            napthalene.AddBond(napthalene.Atoms[6], napthalene.Atoms[14], BondOrder.Single);
            napthalene.Atoms.Add(builder.NewAtom("H"));
            napthalene.AddBond(napthalene.Atoms[7], napthalene.Atoms[15], BondOrder.Single);
            napthalene.Atoms.Add(builder.NewAtom("H"));
            napthalene.AddBond(napthalene.Atoms[8], napthalene.Atoms[16], BondOrder.Single);
            napthalene.Atoms.Add(builder.NewAtom("H"));
            napthalene.AddBond(napthalene.Atoms[9], napthalene.Atoms[17], BondOrder.Single);

            int height = 2;
            SignatureQuotientGraph mqg = new SignatureQuotientGraph(napthalene, height);

            Assert.AreEqual(4, mqg.GetVertexCount());
            Assert.AreEqual(6, mqg.GetEdgeCount());
            Assert.AreEqual(2, mqg.NumberOfLoopEdges());
        }