Пример #1
0
        public void ResolveFunctionsOverloadsByParameterNameShouldNotThrowIfMultipleResolve()
        {
            var function = new EdmFunction("d.s", "function1", EdmCoreModel.Instance.GetSingle(false));

            function.AddParameter("param1", EdmCoreModel.Instance.GetString(true));
            var function1 = new EdmFunction("d.s", "function1", EdmCoreModel.Instance.GetSingle(false));

            function1.AddParameter("param1", EdmCoreModel.Instance.GetString(true));
            var functions = new EdmOperation[] { function, function1 };

            var selectedFunctions = functions.FilterOperationsByParameterNames(new string[] { "param1" }, false);

            selectedFunctions.Count().Should().Be(2);
        }
Пример #2
0
        public void ResolveFunctionsOverloadsByParameterNameShouldResolve()
        {
            var function          = new EdmFunction("d.s", "function1", EdmCoreModel.Instance.GetSingle(false));
            var functionOverload1 = new EdmFunction("d.s", "function1", EdmCoreModel.Instance.GetSingle(false));

            functionOverload1.AddParameter("foo", EdmCoreModel.Instance.GetSingle(false));
            var functionOverload2 = new EdmFunction("d.s", "function1", EdmCoreModel.Instance.GetSingle(false));

            functionOverload2.AddParameter("foo", EdmCoreModel.Instance.GetSingle(false));
            functionOverload2.AddParameter("foo2", EdmCoreModel.Instance.GetSingle(false));

            var functions        = new EdmOperation[] { function, functionOverload1, functionOverload2 };
            var resolvedFunction = functions.FilterOperationsByParameterNames(new string[] { "foo" }, false);

            resolvedFunction.First().Should().BeSameAs(functionOverload1);
        }