Exemplo n.º 1
0
        public void ToExplicitEdge_NonImplicitIdentity()
        {
            Graph g = new Graph(0);

            foreach (var b in Bond.Values)
            {
                if (b != Bond.Implicit)
                {
                    Edge e = new Edge(0, 1, Bond.Single);
                    Assert.AreSame(e, ImplicitToExplicit
                                   .ToExplicitEdge(g, e));
                }
            }
        }
Exemplo n.º 2
0
        public void ToExplicitEdge()
        {
            Graph g = new Graph(2);

            var mock_u = new Mock <IAtom>();
            var mock_v = new Mock <IAtom>();

            mock_u.Setup(n => n.IsAromatic()).Returns(false);
            mock_v.Setup(n => n.IsAromatic()).Returns(false);

            g.AddAtom(mock_u.Object);
            g.AddAtom(mock_v.Object);

            Edge e = new Edge(0, 1, Bond.Implicit);

            Assert.AreNotSame(e, ImplicitToExplicit.ToExplicitEdge(g, e));

            Assert.AreEqual(new Edge(0, 1, Bond.Single), ImplicitToExplicit.ToExplicitEdge(g, e));
        }