public virtual void TestGetMonomer_String_String() { IBioPolymer oBioPolymer = (IBioPolymer)NewChemObject(); IStrand oStrand1 = oBioPolymer.Builder.NewStrand(); oStrand1.StrandName = "A"; IStrand oStrand2 = oBioPolymer.Builder.NewStrand(); oStrand2.StrandName = "B"; IMonomer oMono1 = oBioPolymer.Builder.NewMonomer(); oMono1.MonomerName = "TRP279"; IMonomer oMono2 = oBioPolymer.Builder.NewMonomer(); oMono2.MonomerName = "HOH"; IAtom oAtom1 = oBioPolymer.Builder.NewAtom("C"); IAtom oAtom2 = oBioPolymer.Builder.NewAtom("C"); IAtom oAtom3 = oBioPolymer.Builder.NewAtom("C"); oBioPolymer.AddAtom(oAtom1, oMono1, oStrand1); oBioPolymer.AddAtom(oAtom2, oMono1, oStrand1); oBioPolymer.AddAtom(oAtom3, oMono2, oStrand2); Assert.AreEqual(oMono1, oBioPolymer.GetMonomer("TRP279", "A")); Assert.AreEqual(oMono2, oBioPolymer.GetMonomer("HOH", "B")); }
public virtual void TestAddAtom_IAtom_IMonomer_IStrand() { IBioPolymer oBioPolymer = (IBioPolymer)NewChemObject(); IStrand oStrand1 = oBioPolymer.Builder.NewStrand(); oStrand1.StrandName = "A"; IMonomer oMono1 = oBioPolymer.Builder.NewMonomer(); oMono1.MonomerName = "TRP279"; IAtom oAtom1 = oBioPolymer.Builder.NewAtom("C"); IAtom oAtom2 = oBioPolymer.Builder.NewAtom("C"); oBioPolymer.AddAtom(oAtom1, oMono1, oStrand1); oBioPolymer.AddAtom(oAtom2, oMono1, oStrand1); oBioPolymer.AddAtom(oAtom1, null, oStrand1); Assert.AreEqual(2, oBioPolymer.GetMonomer("TRP279", "A").Atoms.Count); Assert.AreEqual(0, oBioPolymer.GetMonomer("", "A").Atoms.Count); }