Esempio n. 1
0
        public override void TestToString()
        {
            IAminoAcid m         = (IAminoAcid)NewChemObject();
            IAtom      nTerminus = m.Builder.NewAtom("N");

            m.AddNTerminus(nTerminus);
            string description = m.ToString();

            for (int i = 0; i < description.Length; i++)
            {
                Assert.IsTrue('\n' != description[i]);
                Assert.IsTrue('\r' != description[i]);
            }

            m = (IAminoAcid)NewChemObject();
            IAtom cTerminus = m.Builder.NewAtom("C");

            m.AddCTerminus(cTerminus);
            description = m.ToString();
            for (int i = 0; i < description.Length; i++)
            {
                Assert.IsTrue('\n' != description[i]);
                Assert.IsTrue('\r' != description[i]);
            }
        }
Esempio n. 2
0
        public virtual void TestAddCTerminus_IAtom()
        {
            IAminoAcid m         = (IAminoAcid)NewChemObject();
            IAtom      cTerminus = m.Builder.NewAtom("C");

            m.AddCTerminus(cTerminus);
            Assert.AreEqual(cTerminus, m.CTerminus);
        }
Esempio n. 3
0
        public void TestRemoveAcidicOxygen_IAminoAcid()
        {
            IAminoAcid glycine = builder.NewAminoAcid();

            glycine.Add(CDK.SmilesParser.ParseSmiles("C(C(=O)O)N"));
            Assert.AreEqual(5, glycine.Atoms.Count);
            glycine.AddCTerminus(glycine.Atoms[1]);
            AminoAcidManipulator.RemoveAcidicOxygen(glycine);
            Assert.AreEqual(4, glycine.Atoms.Count);
        }
Esempio n. 4
0
        public void TestAddAcidicOxygen_IAminoAcid()
        {
            // FIXME: I think this is the proper test, but it currently fails
            IAminoAcid glycine = builder.NewAminoAcid();

            glycine.Add(CDK.SmilesParser.ParseSmiles("C(C=O)N"));
            Assert.AreEqual(4, glycine.Atoms.Count);
            glycine.AddCTerminus(glycine.Atoms[1]);
            AminoAcidManipulator.AddAcidicOxygen(glycine);
            Assert.AreEqual(5, glycine.Atoms.Count);
        }
Esempio n. 5
0
        public override void TestClone()
        {
            IAminoAcid aa    = (IAminoAcid)NewChemObject();
            object     clone = aa.Clone();

            Assert.IsTrue(clone is IAminoAcid);
            Assert.AreNotSame(aa, clone);

            aa = (IAminoAcid)NewChemObject();
            IAtom nTerminus = aa.Builder.NewAtom("N");

            aa.AddNTerminus(nTerminus);
            clone = aa.Clone();
            Assert.IsTrue(clone is IAminoAcid);
            Assert.AreNotSame(aa, clone);

            aa = (IAminoAcid)NewChemObject();
            IAtom cTerminus = aa.Builder.NewAtom("C");

            aa.AddCTerminus(cTerminus);
            clone = aa.Clone();
            Assert.IsTrue(clone is IAminoAcid);
            Assert.AreNotSame(aa, clone);
        }