public void Can_retrieve_properties()
        {
            var property = EdmProperty.CreatePrimitive(
                "P", PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.String));
            var resultBinding = new ModificationFunctionResultBinding("C", property);

            Assert.Equal("C", resultBinding.ColumnName);
            Assert.Same(property, resultBinding.Property);
        }
        public void Can_retrieve_properties()
        {
            var property = EdmProperty.CreatePrimitive(
                "P", PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.String));
            var resultBinding = new ModificationFunctionResultBinding("C", property);

            Assert.Equal("C", resultBinding.ColumnName);
            Assert.Same(property, resultBinding.Property);
        }
        public void Can_configure_result_bindings()
        {
            var modificationFunctionConfiguration = new ModificationStoredProcedureConfiguration();

            var mockPropertyInfo = new MockPropertyInfo();

            modificationFunctionConfiguration
                .Result(new PropertyPath(mockPropertyInfo), "Foo");

            var entitySet = new EntitySet();
            entitySet.ChangeEntityContainerWithoutCollectionFixup(new EntityContainer("C", DataSpace.CSpace));

            var property = new EdmProperty("P1");
            property.SetClrPropertyInfo(mockPropertyInfo);

            var resultBinding = new ModificationFunctionResultBinding("Bar", property);

            modificationFunctionConfiguration.Configure(
                new ModificationFunctionMapping(
                    entitySet,
                    new EntityType("E", "N", DataSpace.CSpace),
                    new EdmFunction("F", "N", DataSpace.SSpace),
                    new[]
                        {
                            new ModificationFunctionParameterBinding(
                                new FunctionParameter(
                                "P",
                                TypeUsage.Create(
                                    PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.String)),
                                ParameterMode.In),
                                new ModificationFunctionMemberPath(new[] { property }, null), false)
                        },
                    null,
                    new[] { resultBinding }),
                ProviderRegistry.Sql2008_ProviderManifest);

            Assert.Equal("Foo", resultBinding.ColumnName);
        }