Beispiel #1
0
        public void TestCompare_NullHybridization()
        {
            SimpleAtomComparator comparator = new SimpleAtomComparator();

            IAtom a1 = builder.NewAtom("C");
            IAtom a2 = builder.NewAtom("C");

            Assert.AreEqual(0, comparator.Compare(a1, a2), "Null hybridzation should be equals");
        }
Beispiel #2
0
        public void TestCompare_DifferentSymbol()
        {
            SimpleAtomComparator comparator = new SimpleAtomComparator();

            IAtom a1 = builder.NewAtom("C");
            IAtom a2 = builder.NewAtom("O");

            // can't do less than correctly without hamcrest?
            Assert.IsTrue(comparator.Compare(a1, a2) < 0, "oxygen should rank above carbon");
            Assert.IsTrue(comparator.Compare(a2, a1) > 0, "oxygen should rank above carbon (inverse)");
        }
Beispiel #3
0
        public void TestCompare_DifferentHybridization()
        {
            SimpleAtomComparator comparator = new SimpleAtomComparator();

            IAtom a1 = builder.NewAtom("C");
            IAtom a2 = builder.NewAtom("C");

            a1.Hybridization = Hybridization.SP2;
            a2.Hybridization = Hybridization.SP3;

            Assert.AreEqual(-1, comparator.Compare(a1, a2), "Atom 2 should have priority");
        }
Beispiel #4
0
        public void TestCompare_SameHybridization()
        {
            SimpleAtomComparator comparator = new SimpleAtomComparator();

            IAtom a1 = builder.NewAtom("C");
            IAtom a2 = builder.NewAtom("C");

            a1.Hybridization = Hybridization.SP3;
            a2.Hybridization = Hybridization.SP3;

            Assert.AreEqual(0, comparator.Compare(a1, a2), "Same hybridzation should be equals");
        }