Example #1
0
        public void TestCreateWriter_IChemFormat()
        {
            IChemFormat       format = (IChemFormat)XYZFormat.Instance;
            IChemObjectWriter writer = factory.CreateWriter(format, new StringWriter());

            Assert.IsNotNull(writer);
            Assert.AreEqual(format.FormatName, writer.Format.FormatName);
        }
Example #2
0
        public void TestCMLWriter()
        {
            WriterFactory factory = new WriterFactory();

            WriterFactory.RegisterWriter(typeof(CMLWriter));
            IChemObjectWriter writer = factory.CreateWriter((IChemFormat)CMLFormat.Instance, new StringWriter());

            Assert.IsNotNull(writer);
            Assert.AreEqual(new CMLWriter(new StringWriter()).GetType().Name, writer.GetType().Name);
        }