Exemplo n.º 1
0
        /*--------------------------------------------------------------------------------------------*/
        protected override void CheckSuccess(bool pSuccess)
        {
            Times t = (pSuccess ? Times.Once() : Times.Never());

            MockItem.Verify(x => x.VerifyParamCount(1, -1), Times.Once);
            MockPath.Verify(x => x.AddScript(vScript), t);
        }
Exemplo n.º 2
0
        /*--------------------------------------------------------------------------------------------*/
        protected override void CheckSuccess(bool pSuccess)
        {
            Times t = (pSuccess ? Times.Once() : Times.Never());

            MockItem.Verify(x => x.VerifyParamCount(0, -1), Times.Once);

            MockPath.Verify(x => x.AddScript(It.IsAny <string>()), Times.Never);
        }
Exemplo n.º 3
0
        public void SuccessToLower()
        {
            vStep = new TravStepEntryWith <FabTravUserRoot, string, FabUser>("cmd", vPropDbName, true);

            MockPath.Setup(x => x.AddParam(vValue.ToLower())).Returns(vValueParam);

            vStep.ConsumePath(MockPath.Object, GetToType());

            MockPath.Verify(x => x.AddParam(vValue), Times.Never());
            MockPath.Verify(x => x.AddParam(vValue.ToLower()), Times.Once());
        }
Exemplo n.º 4
0
        public void SuccessNotInVertex()
        {
            vScript = "[0..91]";
            MockPath.Setup(x => x.AddScript(vScript));

            vStep = new TravStepTake <FabFactor, FabArtifact>("cmd", false);

            vStep.ConsumePath(MockPath.Object, vToType);

            MockItem.Verify(x => x.VerifyParamCount(1, -1), Times.Once);
            MockPath.Verify(x => x.AddScript(vScript), Times.Once);
        }
Exemplo n.º 5
0
        public void SuccessNotInVertex()
        {
            vScript = ".outE(" + vEdgeDbNameParam + ")";
            MockPath.Setup(x => x.AddScript(vScript));

            vStep = new TravStepLink <FabFactor, FabArtifact>("cmd", vEdgeDbName, false);

            vStep.ConsumePath(MockPath.Object, vToType);

            MockItem.Verify(x => x.VerifyParamCount(0, -1), Times.Once);

            MockPath.Verify(x => x.AddParam(vEdgeDbName), Times.Once);
            MockPath.Verify(x => x.AddScript(vScript), Times.Once);
        }
Exemplo n.º 6
0
        public void SuccessTypeFilter()
        {
            const string typeDbName      = DbName.Vert.Vertex.VertexType;
            const byte   typeId          = (byte)VertexType.Id.User;
            const string typeDbNameParam = "_P2";
            const string typeIdParam     = "_P3";
            const string typeScript      = ".has(" + typeDbNameParam + ", Tokens.T.eq, " + typeIdParam + ")";

            MockPath.Setup(x => x.AddScript(typeScript));
            MockPath.Setup(x => x.AddParam(typeDbName)).Returns(typeDbNameParam);
            MockPath.Setup(x => x.AddParam(typeId)).Returns(typeIdParam);

            vStep = new TravStepEntryWhere <FabTravVertexRoot, long, FabVertex>("cmd", vPropDbName);
            vStep.ConsumePath(MockPath.Object, GetToType());

            CheckSuccess(true);
            MockPath.Verify(x => x.AddScript(typeScript), Times.Once);
        }