private TestEncapsulationAttributes UserModifiedEncapsulationAttributes(string field, string property = null, bool isReadonly = false, bool encapsulateFlag = true)
        {
            var testAttrs = new TestEncapsulationAttributes(field, encapsulateFlag, isReadonly);

            if (property != null)
            {
                testAttrs.PropertyName = property;
            }
            return(testAttrs);
        }
        public Func <EncapsulateFieldModel, EncapsulateFieldModel> SetParameters(string originalField, TestEncapsulationAttributes attrs, bool convertFieldsToUDTMembers = false)
        {
            return(model =>
            {
                model.EncapsulateFieldStrategy = convertFieldsToUDTMembers
                    ? EncapsulateFieldStrategy.ConvertFieldsToUDTMembers
                    : EncapsulateFieldStrategy.UseBackingFields;

                var encapsulatedField = model[originalField];
                encapsulatedField.EncapsulateFlag = attrs.EncapsulateFlag;
                encapsulatedField.PropertyIdentifier = attrs.PropertyName;
                encapsulatedField.IsReadOnly = attrs.IsReadOnly;
                return model;
            });
        }