public void TestElevation_Down() { var m_bond = new Mock <IBond>(); var bond = m_bond.Object; m_bond.SetupGet(n => n.Stereo).Returns(BondStereo.Down); Assert.AreEqual(-1, GeometricCumulativeDoubleBondFactory.Elevation(bond)); }
public void TestAxialEncoder_Empty() { var m_container = new Mock <IAtomContainer>(); var container = m_container.Object; var m_start = new Mock <IAtom>(); var start = m_start.Object; var m_end = new Mock <IAtom>(); var end = m_end.Object; m_container.Setup(n => n.GetConnectedBonds(start)).Returns(new IBond[0]); m_container.Setup(n => n.GetConnectedBonds(end)).Returns(new IBond[0]); Assert.IsNull(GeometricCumulativeDoubleBondFactory.AxialEncoder(container, start, end)); }
public void TestElevation_Atom_Down() { var m_a1 = new Mock <IAtom>(); var a1 = m_a1.Object; var m_a2 = new Mock <IAtom>(); var a2 = m_a2.Object; var m_bond = new Mock <IBond>(); var bond = m_bond.Object; m_bond.SetupGet(n => n.Stereo).Returns(BondStereo.Down); m_bond.SetupGet(n => n.Begin).Returns(a1); m_bond.SetupGet(n => n.End).Returns(a2); Assert.AreEqual(-1, GeometricCumulativeDoubleBondFactory.Elevation(bond, a1)); Assert.AreEqual(+1, GeometricCumulativeDoubleBondFactory.Elevation(bond, a2)); }
public void TestCreate() { var m = new AtomContainer(); m.Atoms.Add(CarbonAt(-0.2994, 3.2084)); m.Atoms.Add(CarbonAt(-1.1244, 3.2084)); m.Atoms.Add(CarbonAt(-1.9494, 3.2084)); m.Atoms.Add(CarbonAt(-2.3619, 2.4939)); m.Atoms.Add(CarbonAt(0.1131, 3.9228)); m.Bonds.Add(new Bond(m.Atoms[0], m.Atoms[1], BondOrder.Double)); m.Bonds.Add(new Bond(m.Atoms[1], m.Atoms[2], BondOrder.Double)); m.Bonds.Add(new Bond(m.Atoms[2], m.Atoms[3])); m.Bonds.Add(new Bond(m.Atoms[0], m.Atoms[4])); IStereoEncoderFactory factory = new GeometricCumulativeDoubleBondFactory(); // graph not used IStereoEncoder encoder = factory.Create(m, null); Assert.IsInstanceOfType(encoder, typeof(MultiStereoEncoder)); }
public void TestElevation_null() { var m_bond = new Mock <IBond>(); var bond = m_bond.Object; Assert.AreEqual(0, GeometricCumulativeDoubleBondFactory.Elevation(bond)); }