Exemple #1
0
        public void TranslatorShouldFailOnUnrecognizedFunctionCall()
        {
            var    node      = new SingleValueFunctionCallNode("fake", new[] { Parameter <string>("s"), Constant("foo") }, null);
            Action translate = () => this.testSubject.TranslateNode(node);

            translate.ShouldThrow <DataServiceException>(ErrorStrings.RequestQueryParser_UnknownFunction("fake"));
        }
Exemple #2
0
        public void TranslatorShouldFailOnReplaceIfDisabled()
        {
            var withReplaceDisabled = this.CreateTestSubject(new DataServiceBehavior {
                AcceptReplaceFunctionInQuery = false
            });
            var    node      = new SingleValueFunctionCallNode("replace", new[] { Parameter <string>("s"), Constant("foo"), Constant("bar") }, null);
            Action translate = () => withReplaceDisabled.TranslateNode(node);

            translate.ShouldThrow <DataServiceException>(ErrorStrings.RequestQueryParser_UnknownFunction("fake"));
        }