Esempio n. 1
0
        public void TestCalculate_NoModifications()
        {
            var atom  = Water.Atoms[1];
            var clone = (IAtom)Water.Atoms[1].Clone();

            Descriptor.Calculate(atom);
            var diff = AtomDiff.Diff(clone, atom);

            Assert.AreEqual(0, diff.Length, $"The descriptor must not change the passed atom in any respect, but found this diff: {diff}");
        }
Esempio n. 2
0
        public void TestIElement_Symbol()
        {
            IAtomContainer mol  = builder.NewAtomContainer();
            IAtom          atom = builder.NewAtom("C");

            atom.Id = "a1";
            mol.Atoms.Add(atom);
            IAtomContainer copy       = CMLRoundTripTool.RoundTripMolecule(convertor, mol);
            string         difference = AtomDiff.Diff(atom, copy.Atoms[0]);

            Assert.AreEqual(0, difference.Length, "Found non-zero diff: " + difference);
        }
Esempio n. 3
0
        public override void TestClone()
        {
            IAtom  atom  = (IAtom)NewChemObject();
            object clone = atom.Clone();

            Assert.IsTrue(clone is IAtom);

            // test that everything has been cloned properly
            string diff = AtomDiff.Diff(atom, (IAtom)clone);

            Assert.IsNotNull(diff);
            Assert.AreEqual(0, diff.Length);
        }
Esempio n. 4
0
        public void TestIAtom_FractionalPoint3d()
        {
            IAtomContainer mol  = builder.NewAtomContainer();
            IAtom          atom = builder.NewAtom("C");

            atom.Id = "a1";
            atom.FractionalPoint3D = new Vector3(1, 2, 3);
            mol.Atoms.Add(atom);
            IAtomContainer copy       = CMLRoundTripTool.RoundTripMolecule(convertor, mol);
            string         difference = AtomDiff.Diff(atom, copy.Atoms[0]);

            Assert.AreEqual(0, difference.Length, "Found non-zero diff: " + difference);
        }