public void TestWrite() { StringWriter strWriter = new StringWriter(); Mopac7Writer writer = new Mopac7Writer(strWriter); var mol = new AtomContainer(); mol.Atoms.Add(new Atom("Cr")); writer.Write(mol); writer.Close(); Assert.IsTrue(strWriter.ToString().Contains("PM3")); Assert.IsTrue(strWriter.ToString().Contains("Cr ")); Assert.IsTrue(strWriter.ToString().Contains("Generated by")); }
public void TestChargedCompounds() { var mol = new AtomContainer(); IAtom aluminum = new Atom("Al"); aluminum.FormalCharge = +3; mol.Atoms.Add(aluminum); StringWriter strWriter = new StringWriter(); Mopac7Writer writer = new Mopac7Writer(strWriter); writer.Write(mol); writer.Close(); Assert.IsTrue(strWriter.ToString().Contains("CHARGE=3")); }
public void TestWriteWithOptimizationFalse() { var mol = new AtomContainer(); mol.Atoms.Add(new Atom("Cr")); StringWriter strWriter = new StringWriter(); Mopac7Writer writer = new Mopac7Writer(strWriter); var customizations = new NameValueCollection(); customizations["optimize"] = "false"; writer.Listeners.Add(new PropertiesListener(customizations)); writer.Write(mol); writer.Close(); Assert.IsFalse(strWriter.ToString().Contains("PRECISE")); }
public void TestWriteWithCustomCommands() { var mol = new AtomContainer(); mol.Atoms.Add(new Atom("Cr")); StringWriter strWriter = new StringWriter(); Mopac7Writer writer = new Mopac7Writer(strWriter); var customizations = new NameValueCollection(); customizations["Commands"] = "THIS IS NOT GOING TO WORK"; writer.Listeners.Add(new PropertiesListener(customizations)); writer.Write(mol); writer.Close(); Assert.IsTrue(strWriter.ToString().Contains("THIS IS NOT GOING TO WORK")); }
public void TestAccepts() { Mopac7Writer reader = new Mopac7Writer(new StringWriter()); Assert.IsTrue(reader.Accepts(typeof(AtomContainer))); }