示例#1
0
        public void TestComment()
        {
            var filename = "NCDK.Data.XYZ.viagra_withComment.xyz";

            Trace.TraceInformation("Testing: ", filename);
            var ins      = ResourceLoader.GetAsStream(filename);
            var reader   = new XYZReader(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 som = model.MoleculeSet;

            Assert.IsNotNull(som);
            Assert.AreEqual(1, som.Count);
            var m = som[0];

            Assert.IsNotNull(m);
            Assert.AreEqual(63, m.Atoms.Count);
            Assert.AreEqual(0, m.Bonds.Count);

            // atom 63: H    3.1625    3.1270   -0.9362
            Assert.AreEqual("H", m.Atoms[62].Symbol);
            Assert.IsNotNull(m.Atoms[62].Point3D);
            Assert.AreEqual(3.1625, m.Atoms[62].Point3D.Value.X, 0.0001);
            Assert.AreEqual(3.1270, m.Atoms[62].Point3D.Value.Y, 0.0001);
            Assert.AreEqual(-0.9362, m.Atoms[62].Point3D.Value.Z, 0.0001);
        }
示例#2
0
        public void TestViagra()
        {
            var filename = "NCDK.Data.XYZ.viagra.xyz";

            Trace.TraceInformation("Testing: ", filename);
            var ins      = ResourceLoader.GetAsStream(filename);
            var reader   = new XYZReader(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 som = model.MoleculeSet;

            Assert.IsNotNull(som);
            Assert.AreEqual(1, som.Count);
            var m = som[0];

            Assert.IsNotNull(m);
            Assert.AreEqual(63, m.Atoms.Count);
            Assert.AreEqual(0, m.Bonds.Count);

            Assert.AreEqual("N", m.Atoms[0].Symbol);
            Assert.IsNotNull(m.Atoms[0].Point3D);
            Assert.AreEqual(-3.4932, m.Atoms[0].Point3D.Value.X, 0.0001);
            Assert.AreEqual(-1.8950, m.Atoms[0].Point3D.Value.Y, 0.0001);
            Assert.AreEqual(0.1795, m.Atoms[0].Point3D.Value.Z, 0.0001);
        }