Ejemplo n.º 1
0
        public void ConnectionAlreadSet()
        {
            var r = new RootHasCandy(WeaverEdgeConn.OutOne);

            WeaverTestUtil.CheckThrows <WeaverEdgeException>(true, () => {
                r.Connection = WeaverEdgeConn.OutOneOrMore;
            });
        }
Ejemplo n.º 2
0
        public void ConnectionNotSet()
        {
            var r = new RootHasCandy();

            WeaverTestUtil.CheckThrows <WeaverEdgeException>(true, () => {
                var c = r.Connection;
            });
        }
Ejemplo n.º 3
0
        public void ItemIdentifier()
        {
            var r = new RootHasCandy {
                Id = "abc-123"
            };

            Assert.AreEqual("RootHasCandy(Id='" + r.Id + "')", r.ItemIdentifier,
                            "Incorrect ItemIdentifier.");
        }
Ejemplo n.º 4
0
        public void Connection(WeaverEdgeConn pConn, bool pFromMany, bool pToMany, bool pOut)
        {
            var r = new RootHasCandy {
                Connection = pConn
            };

            Assert.AreEqual(pConn, r.Connection, "Incorrect Connection.");
            Assert.AreEqual(pFromMany, r.IsFromManyVertices, "Incorrect IsFromManyVertexs.");
            Assert.AreEqual(pToMany, r.IsToManyVertices, "Incorrect IsToManyVertexs.");
            Assert.AreEqual(pOut, r.IsOutgoing, "Incorrect IsOutgoing.");
        }
Ejemplo n.º 5
0
        public void ToVertex()
        {
            var mockPath = new Mock <IWeaverPath>();
            var r        = new RootHasCandy {
                Path = mockPath.Object
            };

            Candy toCandy = r.InVertex;

            Assert.NotNull(toCandy, "ToVertex should be filled.");
            mockPath.Verify(x => x.AddItem(It.IsAny <Candy>()), Times.Once());

            Assert.False(toCandy.IsFromVertex, "Incorrect ToVertex.IsFromVertex.");
            Assert.AreEqual(!r.IsToManyVertices, toCandy.ExpectOneVertex,
                            "Incorrect ToVertex.ExpectOneVertex.");
        }
Ejemplo n.º 6
0
        public void FromVertex()
        {
            var mockPath = new Mock <IWeaverPath>();
            var r        = new RootHasCandy {
                Path = mockPath.Object
            };

            Root fromRoot = r.OutVertex;

            Assert.NotNull(fromRoot, "FromVertex should be filled.");
            mockPath.Verify(x => x.AddItem(It.IsAny <Root>()), Times.Once());

            Assert.True(fromRoot.IsFromVertex, "Incorrect FromVertex.IsFromVertex.");
            Assert.AreEqual(!r.IsFromManyVertices, fromRoot.ExpectOneVertex,
                            "Incorrect FromVertex.ExpectOneVertex.");
        }