Пример #1
0
        public void TestDictionaryDatabase()
        {
            DictionaryDatabase db = new DictionaryDatabase();

            Assert.IsTrue(db.HasDictionary("descriptor-algorithms"));
            Assert.IsTrue(db.HasDictionary("reaction-processes"));
        }
Пример #2
0
        public void TestOWLDictionary()
        {
            DictionaryDatabase db = new DictionaryDatabase();
            var dict = db.GetDictionary("descriptor-algorithms");

            Assert.IsTrue(dict.Count > 0);
            Assert.IsNotNull(dict.NS);
        }
Пример #3
0
        public void TestHasDictionary()
        {
            DictionaryDatabase db = new DictionaryDatabase();
            var dbs = db.ListDictionaries();

            Assert.IsNotNull(dbs);
            Assert.IsTrue(dbs.Count() > 0);
            foreach (var dbName in dbs)
            {
                Assert.IsTrue(db.HasDictionary(dbName));
            }
        }
Пример #4
0
        public void TestGetDictionaryNames()
        {
            DictionaryDatabase db = new DictionaryDatabase();
            var dbs = db.GetDictionaryNames();

            Assert.IsNotNull(dbs);
            Assert.AreNotSame(0, dbs.Count);
            foreach (var dbName in dbs)
            {
                Assert.IsNotNull(dbName);
                Assert.AreNotSame(0, dbName.Length);
            }
        }
Пример #5
0
        public void TestListDictionaries()
        {
            DictionaryDatabase db = new DictionaryDatabase();
            var dbs = db.ListDictionaries();

            Assert.IsNotNull(dbs);
            Assert.IsTrue(dbs.Count() > 0);
            foreach (var dbName in dbs)
            {
                Assert.IsNotNull(dbName);
                Assert.AreNotSame(0, dbName.Length);
            }
        }
Пример #6
0
        public void TestOWLReactEntry()
        {
            DictionaryDatabase db = new DictionaryDatabase();
            var   dict            = db.GetDictionary("reaction-processes");
            Entry entry           = dict["AdductionProtonLP".ToLowerInvariant()];

            Assert.IsNotNull(entry);
            Assert.AreEqual("Adduction Proton from Lone Pair Orbitals", entry.Label);
            string def = entry.Definition;

            Assert.IsNotNull(def);
            //Assert.IsTrue(def.Length > 0);    // tab is tab in java, java is empty in C#
        }
Пример #7
0
        public void TestOWLEntry()
        {
            DictionaryDatabase db = new DictionaryDatabase();
            var   dict            = db.GetDictionary("descriptor-algorithms");
            Entry entry           = dict["apol"];

            Assert.IsNotNull(entry);
            Assert.AreEqual("Atomic Polarizabilities", entry.Label);
            string def = entry.Definition;

            Assert.IsNotNull(def);
            Assert.IsTrue(def.Length > 0);
        }
Пример #8
0
        public void TestCheckUniqueID()
        {
            DictionaryDatabase db = new DictionaryDatabase();
            var dict    = db.GetDictionary("reaction-processes");
            var entries = dict.Entries.ToReadOnlyList();
            var idList  = new List <string>();

            idList.Add(entries[0].Id);
            for (int i = 1; i < entries.Count; i++)
            {
                //            System.Console.Out.WriteLine(entries[i].Id);
                if (!idList.Contains(entries[i].Id))
                {
                    idList.Add(entries[i].Id);
                }
                else
                {
                    Assert.IsFalse(idList.Contains(entries[i].Id), $"The entry is contained {entries[i]}  two times");
                }
            }
        }
Пример #9
0
        public void TestDictDBReact()
        {
            DictionaryDatabase db = new DictionaryDatabase();

            Assert.IsTrue(db.HasDictionary("reaction-processes"));
        }