public void UserDefinedPropertySets()
        {
            var pSetsDef = new Definitions <PropertySetDef>(Version.IFC4);

            pSetsDef.Add(new[]
            {
                new PropertySetDef()
                {
                    Name       = "Sample property set",
                    Definition = "Definition of sample property set.",
                    IfcVersion = new IfcVersion()
                    {
                        schema = "IfcSharedBldgElements", version = "IFC2x3"
                    },
                    _applicableClasses = new List <string>()
                    {
                        "IfcWall", "IfcDoor", "IfcWindow"
                    },
                    PropertyDefinitions = new List <PropertyDef>()
                    {
                        new PropertyDef()
                        {
                            Name         = "Sample property",
                            Definition   = "Sample property description",
                            PropertyType = new PropertyType()
                            {
                                PropertyValueType = new TypePropertySingleValue()
                                {
                                    DataType = new DataType()
                                    {
                                        Type = DataTypeEnum.IfcBoolean
                                    },
                                    UnitType = new UnitType()
                                    {
                                        Type = UnitTypeEnum.AREAUNIT
                                    }
                                }
                            }
                        },
                        new PropertyDef()
                        {
                            Name         = "Sample property II",
                            Definition   = "Sample property II description",
                            PropertyType = new PropertyType()
                            {
                                PropertyValueType = new TypePropertyBoundedValue()
                                {
                                    DataType = new DataType()
                                    {
                                        Type = DataTypeEnum.IfcBoolean
                                    },
                                    ValueRangeDef = new ValueRangeDef()
                                    {
                                        LowerBoundValue = new LowerBoundValue()
                                        {
                                            Value = "456"
                                        },
                                        UpperBoundValue = new UpperBoundValue()
                                        {
                                            Value = "4458"
                                        }
                                    }
                                }
                            }
                        },
                        new PropertyDef()
                        {
                            Name         = "Enumeration",
                            Definition   = "Definition of enumeration property",
                            PropertyType = new PropertyType()
                            {
                                PropertyValueType = new TypePropertyEnumeratedValue()
                                {
                                    EnumList = new EnumList()
                                    {
                                        Name  = "Amazing name",
                                        Items = new List <string>()
                                        {
                                            "A", "B", "C"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            });
            var prop = pSetsDef.GetPropertiesWhere <PropertyDef>(d => d.Name == "Enumeration").FirstOrDefault();

            (prop.PropertyType.PropertyValueType as TypePropertyEnumeratedValue).EnumList.Name = "Amazing name";


            var directory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            directory = Path.Combine(directory, "test_prop_defs");
            if (!Directory.Exists(directory))
            {
                Directory.CreateDirectory(directory);
            }
            pSetsDef.SaveToDirectory(directory);

            var defs2 = new Definitions <PropertySetDef>(Version.IFC4);

            defs2.LoadFromDirectory(directory);

            Assert.IsNotNull(defs2);
            Assert.IsTrue(defs2.GetAllProperties <PropertyDef>(true).Count() == pSetsDef.GetAllProperties <PropertyDef>(true).Count());
        }