public virtual void TestAddAtom_IAtom_IMonomer() { IPolymer oPolymer = (IPolymer)NewChemObject(); IMonomer oMono1 = oPolymer.Builder.NewMonomer(); oMono1.MonomerName = "TRP279"; IMonomer oMono2 = null; IAtom oAtom1 = oPolymer.Builder.NewAtom("C"); IAtom oAtom2 = oPolymer.Builder.NewAtom("C"); IAtom oAtom3 = oPolymer.Builder.NewAtom("C"); oPolymer.Atoms.Add(oAtom1); oPolymer.AddAtom(oAtom2, oMono1); oPolymer.AddAtom(oAtom3, oMono2); Assert.IsNotNull(oPolymer.Atoms[0]); Assert.IsNotNull(oPolymer.Atoms[1]); Assert.IsNotNull(oPolymer.Atoms[2]); Assert.AreEqual(oAtom1, oPolymer.Atoms[0]); Assert.AreEqual(oAtom2, oPolymer.Atoms[1]); Assert.AreEqual(oAtom3, oPolymer.Atoms[2]); Assert.AreEqual(3, oPolymer.Atoms.Count); Assert.AreEqual(1, oPolymer.GetMonomer("TRP279").Atoms.Count); Assert.AreEqual(1, oPolymer.GetMonomerMap().Count()); Assert.IsNotNull(oPolymer.GetMonomer("TRP279")); Assert.AreEqual(oMono1, oPolymer.GetMonomer("TRP279")); }
public virtual void TestGetMonomer_String() { IPolymer oPolymer = (IPolymer)NewChemObject(); IMonomer oMono1 = oPolymer.Builder.NewMonomer(); oMono1.MonomerName = "TRP279"; IMonomer oMono2 = oPolymer.Builder.NewMonomer(); oMono2.MonomerName = "HOH"; IAtom oAtom1 = oPolymer.Builder.NewAtom("C"); IAtom oAtom2 = oPolymer.Builder.NewAtom("C"); IAtom oAtom3 = oPolymer.Builder.NewAtom("C"); oPolymer.AddAtom(oAtom1, oMono1); oPolymer.AddAtom(oAtom2, oMono1); oPolymer.AddAtom(oAtom3, oMono2); Assert.AreEqual(oMono1, oPolymer.GetMonomer("TRP279")); Assert.AreEqual(oMono2, oPolymer.GetMonomer("HOH")); Assert.IsNull(oPolymer.GetMonomer("Mek")); }