public virtual void TestRemoveMonomer_String() { IStrand oStrand = (IStrand)NewChemObject(); IMonomer oMono1 = oStrand.Builder.NewMonomer(); oMono1.MonomerName = "TRP279"; IAtom oAtom1 = oStrand.Builder.NewAtom("C"); oStrand.AddAtom(oAtom1, oMono1); Assert.IsTrue(oStrand.GetMonomerNames().Contains(oMono1.MonomerName)); Assert.AreEqual(1, oStrand.Atoms.Count); oStrand.RemoveMonomer("TRP279"); Assert.IsFalse(oStrand.GetMonomerNames().Contains(oMono1.MonomerName)); Assert.AreEqual(0, oStrand.Atoms.Count); }
public virtual void TestGetMonomers() { IStrand oStrand = (IStrand)NewChemObject(); IMonomer oMono1 = oStrand.Builder.NewMonomer(); oMono1.MonomerName = "TRP279"; IMonomer oMono2 = oStrand.Builder.NewMonomer(); oMono2.MonomerName = "HOH"; IAtom oAtom2 = oStrand.Builder.NewAtom("C"); IAtom oAtom3 = oStrand.Builder.NewAtom("C"); oStrand.AddAtom(oAtom2, oMono1); oStrand.AddAtom(oAtom3, oMono2); IDictionary <string, IMonomer> monomers = new Dictionary <string, IMonomer>(); IMonomer oMon = oStrand.Builder.NewMonomer(); oMon.MonomerName = ""; oMon.MonomerType = "Unknown"; monomers.Add("", oMon); monomers.Add("TRP279", oMono1); monomers.Add("HOH", oMono2); Assert.IsTrue(Compares.AreDeepEqual(monomers.Keys, oStrand.GetMonomerNames())); }