public void GetVertexCount() { IAtomContainer ac = MakeAtomContainer("CCCC"); AtomRefinable refinable = new AtomRefinable(ac); Assert.AreEqual(ac.Atoms.Count, refinable.GetVertexCount()); }
public void Cube2eneWithBonds() { AtomRefinable ar = Make(Cubene(), false); EquitablePartitionRefiner refiner = new EquitablePartitionRefiner(ar); Partition finer = refiner.Refine(Partition.Unit(8)); Partition expected = Partition.FromString("0,2,5,7|1,3,4,6"); Assert.AreEqual(expected, finer); }
public void Cube2eneWithoutBonds() { AtomRefinable ar = Make(Cubene(), true); EquitablePartitionRefiner refiner = new EquitablePartitionRefiner(ar); Partition finer = refiner.Refine(Partition.Unit(8)); Partition expected = Partition.Unit(8); Assert.AreEqual(expected, finer); }
public void GetConnectivity() { string acpString = "C0C1C2C3 0:1(1),1:2(2),2:3(3)"; IAtomContainer ac = AtomContainerPrinter.FromString(acpString, builder); AtomRefinable refinable = new AtomRefinable(ac); Assert.AreEqual(1, refinable.GetConnectivity(0, 1)); Assert.AreEqual(2, refinable.GetConnectivity(1, 2)); Assert.AreEqual(3, refinable.GetConnectivity(2, 3)); }
public void NeighboursInBlockForMultipleBondsIgnoringBondOrders() { string acpString = "C0C1C2C3C4 0:1(1),0:2(2),0:3(1),1:4(1),2:4(1),3:4(2)"; IAtomContainer ac = AtomContainerPrinter.FromString(acpString, builder); AtomRefinable refinable = new AtomRefinable(ac, false, true); IInvariant invariant = refinable.NeighboursInBlock(Set(1, 2), 0); Assert.IsTrue(invariant is IntegerInvariant); Assert.AreEqual(new IntegerInvariant(2), invariant); }
public void NeighboursInBlockForSingleBonds() { string acpString = "C0C1C2C3 0:1(1),0:3(1),1:2(1),2:3(1)"; IAtomContainer ac = AtomContainerPrinter.FromString(acpString, builder); AtomRefinable refinable = new AtomRefinable(ac); IInvariant invariant = refinable.NeighboursInBlock(Set(0, 2), 1); Assert.IsTrue(invariant is IntegerInvariant); Assert.AreEqual(new IntegerInvariant(2), invariant); }
public void DisorderedElementPartitionTest() { IAtomContainer ac = MakeAtomContainer("NNNNCCCCOOOO"); Partition expected = Partition.FromString("4,5,6,7|0,1,2,3|8,9,10,11"); AtomRefinable refinable = new AtomRefinable(ac); Partition elPartition = refinable.GetInitialPartition(); Assert.AreEqual(expected, elPartition); }
public void OddEvenElementPartitionTest() { IAtomContainer ac = MakeAtomContainer("CNCNCN"); Partition expected = Partition.FromString("0,2,4|1,3,5"); AtomRefinable refinable = new AtomRefinable(ac); Partition elPartition = refinable.GetInitialPartition(); Assert.AreEqual(expected, elPartition); }
public void GetElementPartitionTest() { string acpString = "C0N1C2P3C4N5"; Partition expected = Partition.FromString("0,2,4|1,5|3"); IAtomContainer ac = AtomContainerPrinter.FromString(acpString, builder); AtomRefinable refinable = new AtomRefinable(ac); Partition elPartition = refinable.GetInitialPartition(); Assert.AreEqual(expected, elPartition); }