Пример #1
0
 public void TestGetMaximumBondOrder_Order_Order_Unset()
 {
     Assert.AreEqual(BondOrder.Single,
                     BondManipulator.GetMaximumBondOrder(BondOrder.Single, BondOrder.Unset));
     Assert.AreEqual(BondOrder.Single,
                     BondManipulator.GetMaximumBondOrder(BondOrder.Unset, BondOrder.Single));
 }
Пример #2
0
 public void TestCreateBondOrder_Double()
 {
     Assert.AreEqual(BondOrder.Single, BondManipulator.CreateBondOrder(1.0));
     Assert.AreEqual(BondOrder.Double, BondManipulator.CreateBondOrder(2.0));
     Assert.AreEqual(BondOrder.Triple, BondManipulator.CreateBondOrder(3.0));
     Assert.AreEqual(BondOrder.Quadruple, BondManipulator.CreateBondOrder(4.0));
     Assert.AreEqual(BondOrder.Quintuple, BondManipulator.CreateBondOrder(5.0));
     Assert.AreEqual(BondOrder.Sextuple, BondManipulator.CreateBondOrder(6.0));
 }
Пример #3
0
 public void TestDestroyBondOrder_BondOrder()
 {
     Assert.AreEqual(1.0, BondManipulator.DestroyBondOrder(BondOrder.Single), 0.00001);
     Assert.AreEqual(2.0, BondManipulator.DestroyBondOrder(BondOrder.Double), 0.00001);
     Assert.AreEqual(3.0, BondManipulator.DestroyBondOrder(BondOrder.Triple), 0.00001);
     Assert.AreEqual(4.0, BondManipulator.DestroyBondOrder(BondOrder.Quadruple), 0.00001);
     Assert.AreEqual(5.0, BondManipulator.DestroyBondOrder(BondOrder.Quintuple), 0.00001);
     Assert.AreEqual(6.0, BondManipulator.DestroyBondOrder(BondOrder.Sextuple), 0.00001);
 }
Пример #4
0
 public void TestDecreaseBondOrder_BondOrder()
 {
     Assert.AreEqual(BondOrder.Single, BondManipulator.DecreaseBondOrder(BondOrder.Single));
     Assert.AreEqual(BondOrder.Single, BondManipulator.DecreaseBondOrder(BondOrder.Double));
     Assert.AreEqual(BondOrder.Double, BondManipulator.DecreaseBondOrder(BondOrder.Triple));
     Assert.AreEqual(BondOrder.Triple, BondManipulator.DecreaseBondOrder(BondOrder.Quadruple));
     Assert.AreEqual(BondOrder.Quadruple, BondManipulator.DecreaseBondOrder(BondOrder.Quintuple));
     Assert.AreEqual(BondOrder.Quintuple, BondManipulator.DecreaseBondOrder(BondOrder.Sextuple));
 }
Пример #5
0
        public void TestGetMaximumBondOrder_IBond_IBond_null()
        {
            IBond bond1 = new Bond();

            bond1.Order = BondOrder.Unset;
            IBond bond2 = new Bond();

            bond2.Order = BondOrder.Double;
            BondManipulator.GetMaximumBondOrder(null, bond2);
        }
Пример #6
0
        public void TestGetMaximumBondOrder_IBond_IBond_Unset()
        {
            IBond bond1 = new Bond();

            bond1.Order = BondOrder.Unset;
            IBond bond2 = new Bond();

            bond2.Order = BondOrder.Double;
            Assert.AreEqual(BondOrder.Double, BondManipulator.GetMaximumBondOrder(bond1, bond2));
        }
Пример #7
0
        public void TestGetMaximumBondOrder_IBond_IBond()
        {
            IBond bond1 = new Bond();

            bond1.Order = BondOrder.Single;
            IBond bond2 = new Bond();

            bond2.Order = BondOrder.Quadruple;
            Assert.AreEqual(BondOrder.Quadruple, BondManipulator.GetMaximumBondOrder(bond1, bond2));
        }
Пример #8
0
        public void TestGetAtomArray_IBond()
        {
            IAtom atom1 = new Atom(ChemicalElement.C);
            IAtom atom2 = new Atom(ChemicalElement.C);
            IBond bond  = new Bond(atom1, atom2, BondOrder.Triple);

            IAtom[] atoms = BondManipulator.GetAtomArray(bond);
            Assert.AreEqual(2, atoms.Length);
            Assert.AreEqual(atom1, atoms[0]);
            Assert.AreEqual(atom2, atoms[1]);
        }
Пример #9
0
        public void TestGetMinimumBondOrder_HigherOrders()
        {
            List <IBond> bonds = new List <IBond>();
            IBond        bond  = new Bond();

            bond.Order = BondOrder.Quintuple;
            bonds.Add(bond);
            bond       = new Bond();
            bond.Order = BondOrder.Sextuple;
            bonds.Add(bond);
            Assert.AreEqual(BondOrder.Quintuple, BondManipulator.GetMinimumBondOrder(bonds));
        }
Пример #10
0
        public void TestGetMinimumBondOrder_Iterator()
        {
            List <IBond> bonds = new List <IBond>();
            IBond        bond  = new Bond();

            bond.Order = BondOrder.Double;
            bonds.Add(bond);
            bond       = new Bond();
            bond.Order = BondOrder.Quadruple;
            bonds.Add(bond);
            bond       = new Bond();
            bond.Order = BondOrder.Triple;
            bonds.Add(bond);
            Assert.AreEqual(BondOrder.Double, BondManipulator.GetMinimumBondOrder(bonds));
        }
Пример #11
0
        public void TestGetMaximumBondOrder_List()
        {
            List <IBond> bonds = new List <IBond>();
            IBond        bond  = new Bond();

            bond.Order = BondOrder.Single;
            bonds.Add(bond);
            bond       = new Bond();
            bond.Order = BondOrder.Quadruple;
            bonds.Add(bond);
            bond       = new Bond();
            bond.Order = BondOrder.Quadruple;
            bonds.Add(bond);
            Assert.AreEqual(BondOrder.Quadruple, BondManipulator.GetMaximumBondOrder(bonds));
        }
Пример #12
0
        public void TestGetSingleBondEquivalentSum_Iterator()
        {
            List <IBond> bonds = new List <IBond>();
            IBond        bond  = new Bond();

            bond.Order = BondOrder.Single;
            bonds.Add(bond);
            bond       = new Bond();
            bond.Order = BondOrder.Double;
            bonds.Add(bond);
            Assert.AreEqual(3, BondManipulator.GetSingleBondEquivalentSum(bonds));
            bond       = new Bond();
            bond.Order = BondOrder.Quadruple;
            bonds.Add(bond);
            Assert.AreEqual(7, BondManipulator.GetSingleBondEquivalentSum(bonds));
        }
Пример #13
0
        public void TestDecreaseBondOrder_IBond()
        {
            IBond bond = new Bond();

            bond.Order = BondOrder.Sextuple;
            BondManipulator.DecreaseBondOrder(bond);
            Assert.AreEqual(BondOrder.Quintuple, bond.Order);
            BondManipulator.DecreaseBondOrder(bond);
            Assert.AreEqual(BondOrder.Quadruple, bond.Order);
            BondManipulator.DecreaseBondOrder(bond);
            Assert.AreEqual(BondOrder.Triple, bond.Order);
            BondManipulator.DecreaseBondOrder(bond);
            Assert.AreEqual(BondOrder.Double, bond.Order);
            BondManipulator.DecreaseBondOrder(bond);
            Assert.AreEqual(BondOrder.Single, bond.Order);
            BondManipulator.DecreaseBondOrder(bond);
            Assert.AreEqual(BondOrder.Single, bond.Order);
        }
Пример #14
0
 public void TestIsLowerOrder_BondOrder_BondOrder()
 {
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Single, BondOrder.Single));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Single, BondOrder.Double));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Single, BondOrder.Triple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Single, BondOrder.Quadruple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Single, BondOrder.Quintuple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Single, BondOrder.Sextuple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Double, BondOrder.Single));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Double, BondOrder.Double));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Double, BondOrder.Triple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Double, BondOrder.Quadruple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Double, BondOrder.Quintuple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Double, BondOrder.Sextuple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Triple, BondOrder.Single));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Triple, BondOrder.Double));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Triple, BondOrder.Triple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Triple, BondOrder.Quadruple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Triple, BondOrder.Quintuple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Triple, BondOrder.Sextuple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Quadruple, BondOrder.Single));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Quadruple, BondOrder.Double));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Quadruple, BondOrder.Triple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Quadruple, BondOrder.Quadruple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Quadruple, BondOrder.Quintuple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Quadruple, BondOrder.Sextuple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Quintuple, BondOrder.Single));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Quintuple, BondOrder.Double));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Quintuple, BondOrder.Triple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Quintuple, BondOrder.Quadruple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Quintuple, BondOrder.Quintuple));
     Assert.IsTrue(BondManipulator.IsLowerOrder(BondOrder.Quintuple, BondOrder.Sextuple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Sextuple, BondOrder.Single));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Sextuple, BondOrder.Double));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Sextuple, BondOrder.Triple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Sextuple, BondOrder.Quadruple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Sextuple, BondOrder.Quintuple));
     Assert.IsFalse(BondManipulator.IsLowerOrder(BondOrder.Sextuple, BondOrder.Sextuple));
 }
Пример #15
0
 public void TestGetMaximumBondOrder_Order_Order()
 {
     Assert.AreEqual(BondOrder.Quadruple,
                     BondManipulator.GetMaximumBondOrder(BondOrder.Single, BondOrder.Quadruple));
 }
Пример #16
0
 public void TestGetMaximumBondOrder_UnSet_Unset()
 {
     BondManipulator.GetMaximumBondOrder(BondOrder.Unset, BondOrder.Unset);
 }