public virtual void TestRead_IChemObject()
        {
            Assert.IsNotNull(TestFile, "No test file has been set!");

            bool read = false;

            foreach (var obj in AcceptableChemObjects())
            {
                if (ChemObjectIOToTest.Accepts(obj.GetType()))
                {
                    var ins = ResourceLoader.GetAsStream(TestFile);
                    using (var reader = CreateSimpleChemObjectReader(ins))
                    {
                        IChemObject readObject = reader.Read(obj);
                        Assert.IsNotNull(readObject, "Failed attempt to read the file as " + obj.GetType().Name);
                        read = true;
                    }
                }
            }
            if (!read)
            {
                Assert.Fail("Reading an IChemObject from the Reader did not work properly.");
            }
        }
Example #2
0
 public void TestAccepts()
 {
     Assert.IsTrue(ChemObjectIOToTest.Accepts(typeof(IChemFile)));
 }
Example #3
0
 public void TestAccepts()
 {
     Assert.IsTrue(ChemObjectIOToTest.Accepts(typeof(IAtomContainer)));
 }