public void SucessOperations(string pOperation, string pGremlin)
        {
            vOperation = pOperation;
            vScript    = ".has(" + vPropDbNameParam + ", " + pGremlin + ", " + vValueParam + ")";

            MockItem.Setup(x => x.GetParamAt <string>(0)).Returns(vOperation);
            MockPath.Setup(x => x.AddScript(vScript));

            vStep.ConsumePath(MockPath.Object, GetToType());
            CheckSuccess(true);
        }
Exemple #2
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());
        }
        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);
        }