public void Covering_ifcCoveringType_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcCovering ifcCovering;
                using (var txn = model.BeginTransaction())
                {
                    ifcCovering = model.Instances.New<IfcCovering>();

                    IfcRelDefinesByType ifcRelDefinesByType = model.Instances.New<IfcRelDefinesByType>();
                    IfcCoveringType ifcCoveringType = model.Instances.New<IfcCoveringType>();
                    ifcCoveringType.PredefinedType = IfcCoveringTypeEnum.CLADDING;

                    //set up relationship
                    ifcRelDefinesByType.RelatingType = ifcCoveringType;
                    ifcRelDefinesByType.RelatedObjects.Add(ifcCovering);
                    txn.Commit();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Mechanical;//should fail with Mechanical
                Assert.IsFalse(MergeTool.Merge(ifcCovering, fileRoles));

                fileRoles = COBieMergeRoles.Architectural | COBieMergeRoles.Electrical | COBieMergeRoles.Plumbing | COBieMergeRoles.FireProtection;//should pass with Architectural
                Assert.IsTrue(MergeTool.Merge(ifcCovering, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Architectural; //should pass with Architectural
                Assert.IsTrue(MergeTool.Merge(ifcCovering, fileRoles));

            }
        }
        public void DistributionControlElement_ifcActuatorType_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcDistributionControlElement ifcDistributionControlElement;
                using (var txn = model.BeginTransaction())
                {
                    ifcDistributionControlElement = model.Instances.New<IfcDistributionControlElement>();

                    IfcRelDefinesByType ifcRelDefinesByType = model.Instances.New<IfcRelDefinesByType>();
                    IfcActuatorType ifcActuatorType = model.Instances.New<IfcActuatorType>();
                    ifcActuatorType.PredefinedType = IfcActuatorTypeEnum.ELECTRICACTUATOR;

                    //set up relationship between IfcActuatorType and IfcDistributionControlElement
                    ifcRelDefinesByType.RelatingType = ifcActuatorType;
                    ifcRelDefinesByType.RelatedObjects.Add(ifcDistributionControlElement);
                    txn.Commit();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Architectural;//should fail with Architectural
                Assert.IsFalse(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                fileRoles = COBieMergeRoles.Electrical | COBieMergeRoles.Plumbing;//should pass with Electrical or Plumbing
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Plumbing; //should pass with Plumbing
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

            }
        }
        public void EnergyConversionDevice_ifcEvaporativeCoolerType_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcEnergyConversionDevice ifcEnergyConversionDevice;
                using (var txn = model.BeginTransaction())
                {
                    ifcEnergyConversionDevice = model.Instances.New<IfcEnergyConversionDevice>();

                    IfcRelDefinesByType ifcRelDefinesByType = model.Instances.New<IfcRelDefinesByType>();
                    IfcEvaporativeCoolerType ifcEvaporativeCoolerType = model.Instances.New<IfcEvaporativeCoolerType>();
                    ifcEvaporativeCoolerType.PredefinedType = IfcEvaporativeCoolerTypeEnum.DIRECTEVAPORATIVESLINGERSPACKAGEDAIRCOOLER;

                    //set up relationship
                    ifcRelDefinesByType.RelatingType = ifcEvaporativeCoolerType;
                    ifcRelDefinesByType.RelatedObjects.Add(ifcEnergyConversionDevice);
                    txn.Commit();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Architectural;//should fail with Architectural
                Assert.IsFalse(MergeTool.Merge(ifcEnergyConversionDevice, fileRoles));

                fileRoles = COBieMergeRoles.Mechanical | COBieMergeRoles.Electrical | COBieMergeRoles.Plumbing | COBieMergeRoles.FireProtection;//should pass with Mechanical
                Assert.IsTrue(MergeTool.Merge(ifcEnergyConversionDevice, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Mechanical; //should pass with Mechanical
                Assert.IsTrue(MergeTool.Merge(ifcEnergyConversionDevice, fileRoles));

            }
        }
        public void Door_ifcDoorStyle_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcDoor ifcDoor;
                using (var txn = model.BeginTransaction())
                {
                    ifcDoor = model.Instances.New<IfcDoor>();

                    IfcRelDefinesByType ifcRelDefinesByType = model.Instances.New<IfcRelDefinesByType>();
                    IfcDoorStyle ifcDoorStyle = model.Instances.New<IfcDoorStyle>();
                    ifcDoorStyle.OperationType = IfcDoorStyleOperationEnum.DOUBLE_DOOR_FOLDING;
                    ifcDoorStyle.ConstructionType = IfcDoorStyleConstructionEnum.ALUMINIUM_WOOD;

                    //set up relationship
                    ifcRelDefinesByType.RelatingType = ifcDoorStyle;
                    ifcRelDefinesByType.RelatedObjects.Add(ifcDoor);
                    txn.Commit();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Mechanical;//should fail with Mechanical
                Assert.IsFalse(MergeTool.Merge(ifcDoor, fileRoles));

                fileRoles = COBieMergeRoles.Architectural | COBieMergeRoles.Electrical | COBieMergeRoles.Plumbing | COBieMergeRoles.FireProtection;//should pass with Architectural
                Assert.IsTrue(MergeTool.Merge(ifcDoor, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Architectural; //should pass with Architectural
                Assert.IsTrue(MergeTool.Merge(ifcDoor, fileRoles));

            }
        }
        public void DistributionControlElement_ifcSensorType_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcDistributionControlElement ifcDistributionControlElement;
                IfcSensorType ifcSensorType;
                using (var txn = model.BeginTransaction())
                {
                    ifcDistributionControlElement = model.Instances.New<IfcDistributionControlElement>();

                    IfcRelDefinesByType ifcRelDefinesByType = model.Instances.New<IfcRelDefinesByType>();
                    ifcSensorType = model.Instances.New<IfcSensorType>();
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.FIRESENSOR;

                    //set up relationship between IfcSensorType and IfcDistributionControlElement
                    ifcRelDefinesByType.RelatingType = ifcSensorType;
                    ifcRelDefinesByType.RelatedObjects.Add(ifcDistributionControlElement);
                    txn.Commit();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Architectural;//should fail with Architectural
                Assert.IsFalse(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                fileRoles = COBieMergeRoles.Mechanical | COBieMergeRoles.Electrical | COBieMergeRoles.Plumbing | COBieMergeRoles.FireProtection;//should pass with FireProtection
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.FireProtection; //should pass with FireProtection
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));
                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.FLOWSENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Mechanical; //should pass with Mechanical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.GASSENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Mechanical; //should pass with Mechanical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.HEATSENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.FireProtection; //should pass with FireProtection
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.HUMIDITYSENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Mechanical; //should pass with Mechanical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.LIGHTSENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Electrical; //should pass with Electrical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.MOISTURESENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Mechanical; //should pass with Mechanical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.MOVEMENTSENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Electrical; //should pass with Electrical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.PRESSURESENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Electrical; //should pass with Electrical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.SMOKESENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Electrical; //should pass with Electrical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.SOUNDSENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Electrical; //should pass with Electrical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                using (var txn = model.BeginTransaction())
                {
                    ifcSensorType.PredefinedType = IfcSensorTypeEnum.TEMPERATURESENSOR;
                    txn.Commit();
                }
                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Mechanical; //should pass with Mechanical
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));
            }
        }
        public void Window_ifcWindow_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcWindow ifcWindow;
                using (var txn = model.BeginTransaction())
                {
                    ifcWindow = model.Instances.New<IfcWindow>();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Mechanical;//should fail with Mechanical
                Assert.IsFalse(MergeTool.Merge(ifcWindow, fileRoles));

                fileRoles = COBieMergeRoles.Architectural | COBieMergeRoles.Electrical | COBieMergeRoles.Plumbing | COBieMergeRoles.FireProtection;//should pass with Architectural
                Assert.IsTrue(MergeTool.Merge(ifcWindow, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Architectural; //should pass with Architectural
                Assert.IsTrue(MergeTool.Merge(ifcWindow, fileRoles));

            }
        }
        public void FlowTreatmentDevice_ifcFireSuppressionTerminalType_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcFlowTreatmentDevice ifcFlowTreatmentDevice;
                using (var txn = model.BeginTransaction())
                {
                    ifcFlowTreatmentDevice = model.Instances.New<IfcFlowTreatmentDevice>();

                    IfcRelDefinesByType ifcRelDefinesByType = model.Instances.New<IfcRelDefinesByType>();
                    IfcFireSuppressionTerminalType ifcFireSuppressionTerminalType = model.Instances.New<IfcFireSuppressionTerminalType>();
                    ifcFireSuppressionTerminalType.PredefinedType = IfcFireSuppressionTerminalTypeEnum.FIREHYDRANT;

                    //set up relationship
                    ifcRelDefinesByType.RelatingType = ifcFireSuppressionTerminalType;
                    ifcRelDefinesByType.RelatedObjects.Add(ifcFlowTreatmentDevice);
                    txn.Commit();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Architectural;//should fail with Architectural
                Assert.IsFalse(MergeTool.Merge(ifcFlowTreatmentDevice, fileRoles));

                fileRoles = COBieMergeRoles.Mechanical | COBieMergeRoles.FireProtection | COBieMergeRoles.Plumbing | COBieMergeRoles.FireProtection;//should pass with FireProtection
                Assert.IsTrue(MergeTool.Merge(ifcFlowTreatmentDevice, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.FireProtection; //should pass with FireProtection
                Assert.IsTrue(MergeTool.Merge(ifcFlowTreatmentDevice, fileRoles));

            }
        }
        public void DistributionControlElement_IfcFlowController_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcDistributionControlElement ifcDistributionControlElement;
                using (var txn = model.BeginTransaction())
                {
                    IfcFlowController ifcFlowController = model.Instances.New<IfcFlowController>();
                    IfcRelFlowControlElements ifcRelFlowControlElements = model.Instances.New<IfcRelFlowControlElements>();
                    ifcDistributionControlElement = model.Instances.New<IfcDistributionControlElement>();

                    //set up relationship between IfcFlowController and IfcDistributionControlElement
                    ifcRelFlowControlElements.RelatingFlowElement = ifcFlowController;
                    ifcRelFlowControlElements.RelatedControlElements.Add(ifcDistributionControlElement);
                    txn.Commit();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Architectural;//should fail with Architectural
                Assert.IsFalse(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                fileRoles = COBieMergeRoles.Electrical | COBieMergeRoles.Plumbing;//should pass with Electrical or Plumbing
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Plumbing; //should pass with Plumbing
                Assert.IsTrue(MergeTool.Merge(ifcDistributionControlElement, fileRoles));
            }
        }
        public void FlowController_ifcValveType_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcFlowController ifcFlowController;
                using (var txn = model.BeginTransaction())
                {
                    ifcFlowController = model.Instances.New<IfcFlowController>();

                    IfcRelDefinesByType ifcRelDefinesByType = model.Instances.New<IfcRelDefinesByType>();
                    IfcValveType ifcValveType = model.Instances.New<IfcValveType>();
                    ifcValveType.PredefinedType = IfcValveTypeEnum.ANTIVACUUM;

                    //set up relationship between IfcSwitchingDeviceType and IfcFlowController
                    ifcRelDefinesByType.RelatingType = ifcValveType;
                    ifcRelDefinesByType.RelatedObjects.Add(ifcFlowController);
                    txn.Commit();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Architectural;//should fail with Architectural
                Assert.IsFalse(MergeTool.Merge(ifcFlowController, fileRoles));

                fileRoles = COBieMergeRoles.Mechanical | COBieMergeRoles.Electrical | COBieMergeRoles.Plumbing | COBieMergeRoles.FireProtection;//should pass with Plumbing
                Assert.IsTrue(MergeTool.Merge(ifcFlowController, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Plumbing; //should pass with Plumbing
                Assert.IsTrue(MergeTool.Merge(ifcFlowController, fileRoles));

            }
        }
        public void FlowController_ifcElectricDistributionPoint_Test()
        {
            using (XbimModel model = XbimModel.CreateTemporaryModel())
            {
                model.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1");
                IfcElectricDistributionPoint ifcElectricDistributionPoint;
                using (var txn = model.BeginTransaction())
                {
                    ifcElectricDistributionPoint = model.Instances.New<IfcElectricDistributionPoint>();
                    ifcElectricDistributionPoint.DistributionPointFunction = IfcElectricDistributionPointFunctionEnum.USERDEFINED;
                    ifcElectricDistributionPoint.UserDefinedFunction = "Circuit";

                    txn.Commit();
                }

                FilterValuesOnMerge MergeTool = new FilterValuesOnMerge();

                COBieMergeRoles fileRoles = COBieMergeRoles.Architectural;//should fail with Architectural
                Assert.IsFalse(MergeTool.Merge(ifcElectricDistributionPoint, fileRoles));

                fileRoles = COBieMergeRoles.Mechanical | COBieMergeRoles.Electrical | COBieMergeRoles.Plumbing | COBieMergeRoles.FireProtection;//should pass with Electrical
                Assert.IsTrue(MergeTool.Merge(ifcElectricDistributionPoint, fileRoles));

                fileRoles = COBieMergeRoles.Unknown | COBieMergeRoles.Architectural | COBieMergeRoles.Electrical; //should pass with Electrical
                Assert.IsTrue(MergeTool.Merge(ifcElectricDistributionPoint, fileRoles));

            }
        }