Ejemplo n.º 1
0
        public void TestPrediction()
        {
            var data = new[]
            {
                "=C(//)", "=OCC(//)", "CC(//)", "CC(//)", "CCC(//)", "CC(//)", "CC(//)", "CCC(//)", "CCC(//)",
                "CC(//)", "CC(//)", "CC(//)", "CC(//)", "CCO(//)", "CC(//)", "CCO(//)", "CCO(//)", "CC(//)", "O(//)",
                "CC(//)", "CCC(//)", "CCC(//)", "CCC(//)",
            };

            var result = new double[]
            {
                112.6, 198.6, 29.6, 29.6, 40.1, 29.6, 29.6, 40.1, 40.1, 29.6, 29.6, 29.6, 29.6, 73.1, 29.6,
                73.1, 73.1, 29.6, 54.7, 29.6, 40.1, 40.1, 40.1,
            };

            double prediction;
            var    bp = new BremserOneSphereHOSECodePredictor();

            for (int f = 0; f < data.Length; f++)
            {
                prediction = bp.Predict(data[f]);
                //logger.debug("\"" + prediction + "\",");
                Assert.AreEqual(result[f], prediction, 0.001);
            }
        }
Ejemplo n.º 2
0
        public void TestFailure1()
        {
            bool correct = false;
            var  bp      = new BremserOneSphereHOSECodePredictor();

            try
            {
                bp.Predict("dumb code");
            }
            catch (Exception exc)
            {
                if (exc is CDKException)
                {
                    correct = true;
                }
            }
            Assert.IsTrue(correct);
        }