Skip to content

Commit

Permalink
added some tests to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe Verduci committed Mar 29, 2024
1 parent 6b8a57f commit 200c08d
Show file tree
Hide file tree
Showing 9 changed files with 197 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<ids xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://standards.buildingsmart.org/IDS http://standards.buildingsmart.org/IDS/0.9.7/ids.xsd" xmlns="http://standards.buildingsmart.org/IDS">
<info>
<title>A prohibited classification reference returns the opposite of a required facet</title>
<description>Generated via code automation in the Ids Repository on github.</description>
</info>
<specifications>
<specification name="A prohibited classification reference returns the opposite of a required facet" ifcVersion="IFC2X3 IFC4">
<applicability maxOccurs="unbounded">
<entity>
<name>
<simpleValue>IFCSLAB</simpleValue>
</name>
</entity>
</applicability>
<requirements>
<classification cardinality="prohibited">
<value>
<simpleValue>1</simpleValue>
</value>
<system>
<simpleValue>Foobar</simpleValue>
</system>
</classification>
</requirements>
</specification>
</specifications>
</ids>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2022-10-07T13:48:42',(),(),'IfcOpenShell v0.7.0-dc67287d','IfcOpenShell v0.7.0-dc67287d','');
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPROJECT('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,$,$,$,$,$);
#2=IFCCLASSIFICATION($,$,$,'Foobar',$,$,$);
#3=IFCRELASSOCIATESCLASSIFICATION('05rScmOVzMoQXOfbYdtLYj',$,$,$,(#1),#2);
#4=IFCWALL('3Agm079vPIYBL4JExVrhD5',$,$,$,$,$,$,$,$);
#5=IFCSLAB('0BbkGoC6vPvRW13UT7D8zH',$,$,$,$,$,$,$,$);
#6=IFCCLASSIFICATIONREFERENCE($,'1',$,#2,$,$);
#7=IFCRELASSOCIATESCLASSIFICATION('2nJrDaLQfJ1QPhdJR0o97J',$,$,$,(#5),#6);
#8=IFCCOLUMN('16MocU_IDOF8_x3Iqllz0d',$,$,$,$,$,$,$,$);
#9=IFCCLASSIFICATIONREFERENCE($,'11',$,#2,$,$);
#10=IFCRELASSOCIATESCLASSIFICATION('0WTUhjMwvT39YBFH2pryoM',$,$,$,(#8),#9);
#11=IFCBEAM('1n81bO_6nGjgypJwWUVavJ',$,$,$,$,$,$,$,$);
#12=IFCCLASSIFICATIONREFERENCE($,'22',$,#13,$,$);
#13=IFCCLASSIFICATIONREFERENCE($,'2',$,#2,$,$);
#15=IFCRELASSOCIATESCLASSIFICATION('2jG7cjHsrIUfgKVktNgbzi',$,$,$,(#11),#12);
#16=IFCMATERIAL('Material',$,$);
#17=IFCEXTERNALREFERENCERELATIONSHIP($,$,#6,(#16));
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<ids xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://standards.buildingsmart.org/IDS http://standards.buildingsmart.org/IDS/0.9.7/ids.xsd" xmlns="http://standards.buildingsmart.org/IDS">
<info>
<title>A required classification system fails if no match</title>
<description>Generated via code automation in the Ids Repository on github.</description>
</info>
<specifications>
<specification name="A required classification system fails if no match" ifcVersion="IFC2X3 IFC4">
<applicability maxOccurs="unbounded">
<entity>
<name>
<simpleValue>IFCSLAB</simpleValue>
</name>
</entity>
</applicability>
<requirements>
<classification>
<system>
<simpleValue>Foobar1</simpleValue>
</system>
</classification>
</requirements>
</specification>
</specifications>
</ids>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2022-10-07T13:48:42',(),(),'IfcOpenShell v0.7.0-dc67287d','IfcOpenShell v0.7.0-dc67287d','');
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPROJECT('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,$,$,$,$,$);
#2=IFCCLASSIFICATION($,$,$,'Foobar',$,$,$);
#3=IFCRELASSOCIATESCLASSIFICATION('05rScmOVzMoQXOfbYdtLYj',$,$,$,(#1),#2);
#4=IFCWALL('3Agm079vPIYBL4JExVrhD5',$,$,$,$,$,$,$,$);
#5=IFCSLAB('0BbkGoC6vPvRW13UT7D8zH',$,$,$,$,$,$,$,$);
#6=IFCCLASSIFICATIONREFERENCE($,'1',$,#2,$,$);
#7=IFCRELASSOCIATESCLASSIFICATION('2nJrDaLQfJ1QPhdJR0o97J',$,$,$,(#5),#6);
#8=IFCCOLUMN('16MocU_IDOF8_x3Iqllz0d',$,$,$,$,$,$,$,$);
#9=IFCCLASSIFICATIONREFERENCE($,'11',$,#2,$,$);
#10=IFCRELASSOCIATESCLASSIFICATION('0WTUhjMwvT39YBFH2pryoM',$,$,$,(#8),#9);
#11=IFCBEAM('1n81bO_6nGjgypJwWUVavJ',$,$,$,$,$,$,$,$);
#12=IFCCLASSIFICATIONREFERENCE($,'22',$,#13,$,$);
#13=IFCCLASSIFICATIONREFERENCE($,'2',$,#2,$,$);
#15=IFCRELASSOCIATESCLASSIFICATION('2jG7cjHsrIUfgKVktNgbzi',$,$,$,(#11),#12);
#16=IFCMATERIAL('Material',$,$);
#17=IFCEXTERNALREFERENCERELATIONSHIP($,$,#6,(#16));
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<ids xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://standards.buildingsmart.org/IDS http://standards.buildingsmart.org/IDS/0.9.7/ids.xsd" xmlns="http://standards.buildingsmart.org/IDS">
<info>
<title>Prohibited specifications fails if applicability matches</title>
<description>Generated via code automation in the Ids Repository on github.</description>
</info>
<specifications>
<specification name="Prohibited specifications fails if applicability matches" ifcVersion="IFC2X3">
<applicability minOccurs="0" maxOccurs="0">
<entity>
<name>
<simpleValue>IFCWALL</simpleValue>
</name>
</entity>
</applicability>
</specification>
</specifications>
</ids>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2022-10-07T13:48:44',(),(),'IfcOpenShell v0.7.0-dc67287d','IfcOpenShell v0.7.0-dc67287d','');
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCWALL('1hqIFTRjfV6AWq_bMtnZwI',$,'Waldo',$,$,$,$,$,$);
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<ids xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://standards.buildingsmart.org/IDS http://standards.buildingsmart.org/IDS/0.9.7/ids.xsd" xmlns="http://standards.buildingsmart.org/IDS">
<info>
<title>Prohibited specifications passes if the applicability does not matches</title>
<description>Generated via code automation in the Ids Repository on github.</description>
</info>
<specifications>
<specification name="Prohibited specifications passes if the applicability does not matches" ifcVersion="IFC2X3">
<applicability minOccurs="0" maxOccurs="0">
<entity>
<name>
<simpleValue>IFCWINDOW</simpleValue>
</name>
</entity>
</applicability>
</specification>
</specifications>
</ids>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2022-10-07T13:48:44',(),(),'IfcOpenShell v0.7.0-dc67287d','IfcOpenShell v0.7.0-dc67287d','');
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCWALL('1hqIFTRjfV6AWq_bMtnZwI',$,'Waldo',$,$,$,$,$,$);
ENDSEC;
END-ISO-10303-21;
38 changes: 38 additions & 0 deletions Documentation/testcases/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,15 @@ Requirements:
Classification: Prohibited,Pattern(''\w+'')
```

### A prohibited classification reference returns the opposite of a required facet

``` ids classification/fail-a_prohibited_classification_reference_returns_the_opposite_of_a_required_facet.ids
A prohibited classification reference returns the opposite of a required facet
Entity: ''IFCSLAB''
Requirements:
Classification: Prohibited,''Foobar'',''1''
```

### A required facet checks all parameters as normal

``` ids classification/pass-a_required_facet_checks_all_parameters_as_normal.ids
Expand All @@ -621,6 +630,15 @@ Requirements:
Classification: Pattern(''\w+'')
```

### A required classification system fails if no match

``` ids classification/fail-a_required_classification_system_fails_if_no_match.ids
A required classification system fails if no match
Entity: ''IFCSLAB''
Requirements:
Classification: ''Foobar1''
```

### An optional classification value passes if specified

``` ids classification/pass-an_optional_classification_value_passes_if_specified.ids
Expand Down Expand Up @@ -1127,6 +1145,26 @@ Requirements:
Attribute: ''Name'',''Waldo''
```

### Prohibited specifications fails if the applicability matches

``` ids ids/fail-prohibited_specifications_fails_if_the_applicability_matches.ids
Prohibited specifications fails if applicability matches
Prohibited
IFC2X3
Entity: ''IFCWALL''
Requirements:
```

### Prohibited specifications passes if the applicability does not matches

``` ids ids/pass-prohibited_specifications_passes_if_the_applicability_does_not_matches.ids
Prohibited specifications passes if the applicability does not matches
Prohibited
IFC2X3
Entity: ''IFCWINDOW''
Requirements:
```

### Required specifications need at least one applicable entity (1/2)

``` ids ids/pass-required_specifications_need_at_least_one_applicable_entity_1_2.ids
Expand Down

0 comments on commit 200c08d

Please sign in to comment.