示例#1
0
        public void TestChebi26120()
        {
            var ins      = new StringReader("InChI=1/C40H62/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15,19-22,25,27-30H,13-14,16-18,23-24,26,31-32H2,1-10H3");
            var reader   = new InChIPlainTextReader(ins);
            var chemFile = reader.Read(builder.NewChemFile());

            reader.Close();

            Assert.IsNotNull(chemFile);
            Assert.AreEqual(1, chemFile.Count);
            var seq = chemFile[0];

            Assert.IsNotNull(seq);
            Assert.AreEqual(1, seq.Count);
            var model = seq[0];

            Assert.IsNotNull(model);
            var moleculeSet = model.MoleculeSet;

            Assert.IsNotNull(moleculeSet);
            var molecule = moleculeSet[0];

            Assert.IsNotNull(molecule);

            Assert.AreEqual(40, molecule.Atoms.Count);
            Assert.AreEqual(39, molecule.Bonds.Count);
        }
示例#2
0
        public void TestAccepts()
        {
            var reader = new InChIPlainTextReader(new StringReader(""));

            Assert.IsTrue(reader.Accepts(typeof(IChemFile)));
            reader.Close();
        }
示例#3
0
        public void TestGuanine()
        {
            var filename = "NCDK.Data.InChI.guanine.inchi";

            Trace.TraceInformation("Testing: ", filename);
            var ins      = ResourceLoader.GetAsStream(filename);
            var reader   = new InChIPlainTextReader(ins);
            var chemFile = reader.Read(builder.NewChemFile());

            reader.Close();

            Assert.IsNotNull(chemFile);
            Assert.AreEqual(1, chemFile.Count);
            var seq = chemFile[0];

            Assert.IsNotNull(seq);
            Assert.AreEqual(1, seq.Count);
            var model = seq[0];

            Assert.IsNotNull(model);
            var moleculeSet = model.MoleculeSet;

            Assert.IsNotNull(moleculeSet);
            var molecule = moleculeSet[0];

            Assert.IsNotNull(molecule);

            Assert.AreEqual(11, molecule.Atoms.Count);
            Assert.AreEqual(12, molecule.Bonds.Count);
        }
示例#4
0
        public void TestPlatinum()
        {
            var ins      = new StringReader("InChI=1S/Pt");
            var reader   = new InChIPlainTextReader(ins);
            var chemFile = reader.Read(builder.NewChemFile());

            reader.Close();

            Assert.IsNotNull(chemFile);
            Assert.AreEqual(1, chemFile.Count);
            var seq = chemFile[0];

            Assert.IsNotNull(seq);
            Assert.AreEqual(1, seq.Count);
            var model = seq[0];

            Assert.IsNotNull(model);
            var moleculeSet = model.MoleculeSet;

            Assert.IsNotNull(moleculeSet);
            var molecule = moleculeSet[0];

            Assert.IsNotNull(molecule);

            Assert.AreEqual(1, molecule.Atoms.Count);
            Assert.AreEqual(0, molecule.Bonds.Count);
        }