Exemplo n.º 1
0
        public void BuildParameterizedString(string pPropName, object pValue, string pExpect)
        {
            Expression <Func <Person, object> > func = null;

            switch (pPropName)
            {
            case "PersonId": func = (p => p.PersonId); break;

            case "Name": func = (p => p.Name); break;

            case "Age": func = (p => p.Age); break;
            }

            var val = (pValue is string? "_P0" : pValue + "");

            if (pValue == null)
            {
                val = "null";
            }

            vMockQuery.Setup(x => x.AddParam(It.IsAny <WeaverQueryVal>())).Returns(val);

            vKeyIndex      = new WeaverStepExactIndex <Person>(func, pValue + "");
            vKeyIndex.Path = vMockPath.Object;

            Assert.AreEqual(pExpect, vKeyIndex.BuildParameterizedString(), "Incorrect result.");
        }