public void TestConstructor()
        {
            DoubleBondStereochemistry stereo = new DoubleBondStereochemistry(molecule.Bonds[1], ligands,
                                                                             DoubleBondConformation.Opposite);

            Assert.IsNotNull(stereo);
        }
        public void Contains()
        {
            IChemObjectBuilder builder = ChemObjectBuilder.Instance;

            IAtom c1 = builder.NewAtom("C");
            IAtom c2 = builder.NewAtom("C");
            IAtom o3 = builder.NewAtom("O");
            IAtom o4 = builder.NewAtom("O");

            IBond c1c2 = builder.NewBond(c1, c2, BondOrder.Double);
            IBond c1o3 = builder.NewBond(c1, o3, BondOrder.Single);
            IBond c2o4 = builder.NewBond(c2, o4, BondOrder.Single);

            // new stereo element
            DoubleBondStereochemistry element = new DoubleBondStereochemistry(c1c2, new IBond[] { c1o3, c2o4 },
                                                                              DoubleBondConformation.Opposite);

            Assert.IsTrue(element.Contains(c1));
            Assert.IsTrue(element.Contains(c2));
            Assert.IsTrue(element.Contains(o3));
            Assert.IsTrue(element.Contains(o4));

            Assert.IsFalse(element.Contains(builder.NewAtom()));
            Assert.IsFalse(element.Contains(null));
        }
        public void TestGetStereoBond()
        {
            DoubleBondStereochemistry stereo = new DoubleBondStereochemistry(molecule.Bonds[1], ligands,
                                                                             DoubleBondConformation.Opposite);

            Assert.IsNotNull(stereo);
            Assert.AreEqual(molecule.Bonds[1], stereo.StereoBond);
        }
        public void TestBuilder()
        {
            DoubleBondStereochemistry stereo = new DoubleBondStereochemistry(molecule.Bonds[1], ligands,
                                                                             DoubleBondConformation.Opposite);

            stereo.Builder = ChemObjectBuilder.Instance;
            Assert.AreEqual(ChemObjectBuilder.Instance, stereo.Builder);
        }
        public void TestToString()
        {
            DoubleBondStereochemistry stereo = new DoubleBondStereochemistry(molecule.Bonds[1], ligands,
                                                                             DoubleBondConformation.Opposite);
            string stringRepr = stereo.ToString();

            Assert.AreNotSame(0, stringRepr.Length);
            Assert.IsFalse(stringRepr.Contains("\n"));
        }
        public void TestGetBonds()
        {
            DoubleBondStereochemistry stereo = new DoubleBondStereochemistry(molecule.Bonds[1], ligands,
                                                                             DoubleBondConformation.Opposite);

            Assert.IsNotNull(stereo);
            for (int i = 0; i < ligands.Length; i++)
            {
                Assert.AreEqual(ligands[i], stereo.Bonds[i]);
            }
        }
        public void TestMap_Map_Map_EmptyMapping()
        {
            IChemObjectBuilder builder = ChemObjectBuilder.Instance;

            IAtom c1 = builder.NewAtom("C");
            IAtom c2 = builder.NewAtom("C");
            IAtom o3 = builder.NewAtom("O");
            IAtom o4 = builder.NewAtom("O");

            IBond c1c2 = builder.NewBond(c1, c2, BondOrder.Double);
            IBond c1o3 = builder.NewBond(c1, o3, BondOrder.Single);
            IBond c2o4 = builder.NewBond(c2, o4, BondOrder.Single);

            // new stereo element
            IDoubleBondStereochemistry original = new DoubleBondStereochemistry(c1c2, new IBond[] { c1o3, c2o4 },
                                                                                DoubleBondConformation.Opposite);

            // map the existing element a new element - should through an ArgumentException
            IDoubleBondStereochemistry mapped = (IDoubleBondStereochemistry)original.Clone(new CDKObjectMap());

            Assert.AreSame(original, mapped);
        }