Exemple #1
0
        public void SetReadOnly_is_called_on_child_mapping_items()
        {
            var parameter        = new FunctionParameter();
            var memberPath       = new ModificationFunctionMemberPath(Enumerable.Empty <EdmMember>(), null);
            var parameterBinding = new ModificationFunctionParameterBinding(parameter, memberPath, true);

            Assert.False(memberPath.IsReadOnly);
            parameterBinding.SetReadOnly();
            Assert.True(memberPath.IsReadOnly);
        }
Exemple #2
0
        public void Can_retrieve_properties()
        {
            var parameter        = new FunctionParameter();
            var memberPath       = new ModificationFunctionMemberPath(Enumerable.Empty <EdmMember>(), null);
            var parameterBinding = new ModificationFunctionParameterBinding(parameter, memberPath, true);

            Assert.Same(parameter, parameterBinding.Parameter);
            Assert.Same(memberPath, parameterBinding.MemberPath);
            Assert.Equal(true, parameterBinding.IsCurrent);
        }
        public void SetReadOnly_is_called_on_child_mapping_items()
        {
            var parameter = new FunctionParameter();
            var memberPath = new ModificationFunctionMemberPath(Enumerable.Empty<EdmMember>(), null);
            var parameterBinding = new ModificationFunctionParameterBinding(parameter, memberPath, true);

            Assert.False(memberPath.IsReadOnly);
            parameterBinding.SetReadOnly();
            Assert.True(memberPath.IsReadOnly);
        }
        public void Can_retrieve_properties()
        {
            var parameter = new FunctionParameter();
            var memberPath = new ModificationFunctionMemberPath(Enumerable.Empty<EdmMember>(), null);
            var parameterBinding = new ModificationFunctionParameterBinding(parameter, memberPath, true);

            Assert.Same(parameter, parameterBinding.Parameter);
            Assert.Same(memberPath, parameterBinding.MemberPath);
            Assert.Equal(true, parameterBinding.IsCurrent);
        }
        private void WriteScalarParameterElement(EdmMember member, ModificationFunctionParameterBinding parameterBinding)
        {
            DebugCheck.NotNull(member);
            DebugCheck.NotNull(parameterBinding);

            _xmlWriter.WriteStartElement(MslConstructs.ScalarPropertyElement);
            _xmlWriter.WriteAttributeString(MslConstructs.ScalarPropertyNameAttribute, member.Name);
            _xmlWriter.WriteAttributeString(MslConstructs.ParameterNameAttribute, parameterBinding.Parameter.Name);
            _xmlWriter.WriteAttributeString(
                MslConstructs.ParameterVersionAttribute,
                parameterBinding.IsCurrent
                    ? MslConstructs.ParameterVersionAttributeCurrentValue
                    : MslConstructs.ParameterVersionAttributeOriginalValue);
            _xmlWriter.WriteEndElement();
        }