Ejemplo n.º 1
0
        public void AddEdgeUnregisteredVar(bool pFirst)
        {
            var edge     = new ArtifactCreatedByMember();
            var artAlias = new WeaverVarAlias <Artifact>("art");
            var memAlias = new WeaverVarAlias <Member>("mem");

            var txb = new TxBuilder();

            if (pFirst)
            {
                txb.RegisterVarWithTxBuilder(artAlias);
            }
            else
            {
                txb.RegisterVarWithTxBuilder(memAlias);
            }

            TestUtil.Throws <Exception>(() => txb.AddEdge(artAlias, edge, memAlias));
        }
Ejemplo n.º 2
0
        public void AddEdge()
        {
            var edge     = new ArtifactCreatedByMember();
            var artAlias = new WeaverVarAlias <Artifact>("art");
            var memAlias = new WeaverVarAlias <Member>("mem");

            const string expectScript =
                "g.addEdge(art,mem,_P0);";

            var txb = new TxBuilder();

            txb.RegisterVarWithTxBuilder(artAlias);
            txb.RegisterVarWithTxBuilder(memAlias);
            txb.AddEdge(artAlias, edge, memAlias);

            IWeaverQuery q = GetFirstQuery(txb);

            TestUtil.LogWeaverScript(Log, q);
            Assert.AreEqual(expectScript, q.Script, "Incorrect script.");
            TestUtil.CheckParams(q.Params, "_P",
                                 new List <object> {
                DbName.Edge.ArtifactCreatedByMemberName
            });
        }