Exemplo n.º 1
0
        public override void TestGetStrandNames()
        {
            IPDBPolymer pdbPolymer = (IPDBPolymer)NewChemObject();
            IStrand     oStrand1   = pdbPolymer.Builder.NewStrand();
            IStrand     oStrand2   = pdbPolymer.Builder.NewStrand();

            oStrand1.StrandName = "A";
            oStrand2.StrandName = "B";
            IMonomer oMono1 = pdbPolymer.Builder.NewMonomer();

            oMono1.MonomerName = "TRP279";
            IMonomer oMono2 = pdbPolymer.Builder.NewMonomer();

            oMono2.MonomerName = "GLY123";
            IPDBAtom oPDBAtom1 = pdbPolymer.Builder.NewPDBAtom("C");
            IPDBAtom oPDBAtom2 = pdbPolymer.Builder.NewPDBAtom("C");

            pdbPolymer.AddAtom(oPDBAtom1, oMono1, oStrand1);
            pdbPolymer.AddAtom(oPDBAtom2, oMono2, oStrand2);
            IDictionary <string, IStrand> strands = new Dictionary <string, IStrand>
            {
                { "A", oStrand1 },
                { "B", oStrand2 }
            };

            Assert.IsTrue(Compares.AreDeepEqual(strands.Keys, pdbPolymer.GetStrandNames()));
        }
Exemplo n.º 2
0
        public override void TestRemoveStrand_String()
        {
            IPDBPolymer pdbPolymer = (IPDBPolymer)NewChemObject();
            IStrand     oStrand1   = pdbPolymer.Builder.NewStrand();

            oStrand1.StrandName = "A";
            IMonomer oMono1 = pdbPolymer.Builder.NewMonomer();

            oMono1.MonomerName = "TRP279";
            IPDBAtom oPDBAtom1 = pdbPolymer.Builder.NewPDBAtom("C");

            pdbPolymer.AddAtom(oPDBAtom1, oMono1, oStrand1);

            Assert.IsTrue(pdbPolymer.GetStrandNames().Contains(oStrand1.StrandName));
            Assert.AreEqual(1, pdbPolymer.Atoms.Count);
            pdbPolymer.RemoveStrand("A");
            Assert.IsFalse(pdbPolymer.GetStrandNames().Contains(oStrand1.StrandName));
            Assert.AreEqual(0, pdbPolymer.Atoms.Count);
        }