public void NonCumulatedAtomThrowsException()
        {
            var ac = new AtomContainer();

            ac.Atoms.Add(new Atom("C"));
            ac.Atoms.Add(new Atom("C"));
            ac.Atoms.Add(new Atom("C"));
            ac.AddBond(ac.Atoms[0], ac.Atoms[1], BondOrder.Single);
            ac.AddBond(ac.Atoms[1], ac.Atoms[2], BondOrder.Single);
            ExtendedTetrahedral.FindTerminalAtoms(ac, ac.Atoms[0]);
        }
        public void TerminalAtomsAreFoundUnordered()
        {
            var ac = new AtomContainer();

            ac.Atoms.Add(new Atom("C"));
            ac.Atoms.Add(new Atom("C"));
            ac.Atoms.Add(new Atom("C"));
            ac.AddBond(ac.Atoms[0], ac.Atoms[1], BondOrder.Double);
            ac.AddBond(ac.Atoms[1], ac.Atoms[2], BondOrder.Double);
            IAtom[] terminals = ExtendedTetrahedral.FindTerminalAtoms(ac, ac.Atoms[1]);
            // note order may change
            Assert.AreEqual(ac.Atoms[0], terminals[0]);
            Assert.AreEqual(ac.Atoms[2], terminals[1]);
        }
        public void TerminalAtomsAreFoundOrdered()
        {
            var ac = new AtomContainer();

            ac.Atoms.Add(new Atom("C"));
            ac.Atoms.Add(new Atom("C"));
            ac.Atoms.Add(new Atom("C"));
            ac.Atoms.Add(new Atom("C"));
            ac.Atoms.Add(new Atom("C"));
            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.Double);
            ac.AddBond(ac.Atoms[3], ac.Atoms[4], BondOrder.Single);

            ExtendedTetrahedral element = new ExtendedTetrahedral(ac.Atoms[2], new IAtom[] { ac.Atoms[4], ac.Atoms[3],
                                                                                             ac.Atoms[1], ac.Atoms[0] }, TetrahedralStereo.Clockwise);

            IAtom[] terminals = element.FindTerminalAtoms(ac);
            Assert.AreEqual(ac.Atoms[3], terminals[0]);
            Assert.AreEqual(ac.Atoms[1], terminals[1]);
        }