Esempio n. 1
0
        public void TestPropellane()
        {
            IAtomContainer         propellane = AbstractSignatureTest.MakePropellane();
            SignatureQuotientGraph qGraph     = new SignatureQuotientGraph(propellane);

            CheckParameters(qGraph, 2, 2, 1);
        }
Esempio n. 2
0
        public void TestTwistane()
        {
            IAtomContainer         twistane = AbstractSignatureTest.MakeTwistane();
            SignatureQuotientGraph qGraph   = new SignatureQuotientGraph(twistane);

            CheckParameters(qGraph, 3, 4, 2);
        }
Esempio n. 3
0
        public void TestCuneaneAtHeight2()
        {
            IAtomContainer         cuneane = AbstractSignatureTest.MakeCuneane();
            SignatureQuotientGraph qGraph  = new SignatureQuotientGraph(cuneane, 2);

            CheckParameters(qGraph, 3, 5, 3);
        }
Esempio n. 4
0
        public void TestCubane()
        {
            IAtomContainer         cubane = AbstractSignatureTest.MakeCubane();
            SignatureQuotientGraph qGraph = new SignatureQuotientGraph(cubane);

            CheckParameters(qGraph, 1, 1, 1);
        }
Esempio n. 5
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());
 }
Esempio n. 6
0
        public void TestAromatic()
        {
            IAtomContainer         benzene = AbstractSignatureTest.MakeBenzene();
            SignatureQuotientGraph qGraph  = new SignatureQuotientGraph(benzene);

            CheckParameters(qGraph, 1, 1, 1);
        }
Esempio n. 7
0
        public void IsConnectedTest()
        {
            IAtomContainer singleBond = builder.NewAtomContainer();

            singleBond.Atoms.Add(builder.NewAtom("C"));
            singleBond.Atoms.Add(builder.NewAtom("C"));
            singleBond.AddBond(singleBond.Atoms[0], singleBond.Atoms[1], BondOrder.Single);
            SignatureQuotientGraph quotientGraph = new SignatureQuotientGraph(singleBond);

            Assert.IsTrue(quotientGraph.IsConnected(0, 1));
        }
Esempio n. 8
0
        public void TestC7H16Isomers()
        {
            IAtomContainer         c7H16A  = AbstractSignatureTest.MakeC7H16A();
            IAtomContainer         c7H16B  = AbstractSignatureTest.MakeC7H16B();
            IAtomContainer         c7H16C  = AbstractSignatureTest.MakeC7H16C();
            SignatureQuotientGraph qGraphA = new SignatureQuotientGraph(c7H16A, 1);
            SignatureQuotientGraph qGraphB = new SignatureQuotientGraph(c7H16B, 1);
            SignatureQuotientGraph qGraphC = new SignatureQuotientGraph(c7H16C, 1);

            CheckParameters(qGraphA, 4, 7, 1);
            CheckParameters(qGraphB, 4, 5, 0);
            CheckParameters(qGraphC, 4, 7, 1);
        }
Esempio n. 9
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());
        }