예제 #1
0
        public void TestCompare()
        {
            IChemObjectBuilder builder = ChemObjectBuilder.Instance;
            IRing cycloPentane         = builder.NewRing(5, "C");
            IRing cycloHexane          = builder.NewRing(6, "C");
            IRing cycloHexane2         = builder.NewRing(6, "C");

            RingSizeComparator ringSizeComparator = new RingSizeComparator(SortMode.LargeFirst);

            Assert.IsTrue(ringSizeComparator.Compare(cycloHexane, cycloPentane) == -1);
            Assert.IsTrue(ringSizeComparator.Compare(cycloPentane, cycloHexane) == 1);
            Assert.IsTrue(ringSizeComparator.Compare(cycloHexane, cycloHexane2) == 0);

            ringSizeComparator = new RingSizeComparator(SortMode.SmallFirst);
            Assert.IsTrue(ringSizeComparator.Compare(cycloHexane, cycloPentane) == 1);
            Assert.IsTrue(ringSizeComparator.Compare(cycloPentane, cycloHexane) == -1);
            Assert.IsTrue(ringSizeComparator.Compare(cycloHexane, cycloHexane2) == 0);
        }
예제 #2
0
        public void TestRingSizeComparator_int()
        {
            RingSizeComparator comp = new RingSizeComparator(SortMode.LargeFirst);

            Assert.IsNotNull(comp);
        }