models.autoRealization.Tests.M1.InclusivePropertySet.InclusivePropertySet.md Maven / Gradle / Ivy
# Inclusive Property Set
## Description
This test suite addresses the most essential form of realization, which is to represent
an object reference as an inline object, including all of its properties.
It relies on a bare minimum of features in the realization model:
* `InclusivePropertySet`
* `excludedProperties`
* `PrimitivePropertySelector`
* `ReferencePropertySelector`
## Tests
### AllProperties
- Description
-
The resourceAPI defines only one resource, which is `TaxFilingObject`.
And the realizationModel defines only one template, which applies to all
references.
This should create one realization for TaxFiling, and another for Person (through the
`taxpayer` reference), each having all properties.
- RAPID Model
- InclusivePropertySet_Simple.rapid
- Assertions
-
``` Simple
model.tbTaxFilingObject.check [
named("TaxFiling_AllProperties").selects("AllObjectRefsAsInlineObjects")
withProps [
including("filingID", "jurisdiction", "year", "period", "currency", "grossIncome", "taxLiability")
includingRef("taxpayer") [
named("Person_AllProperties").selects("AllObjectRefsAsInlineObjects")
withOnlyProps("taxpayerID", "lastName", "firstName", "otherNames")
]
checkedAll
]
]
```
### AllPropertiesExcludingPrimitive
- Description
-
The resourceAPI defines only one resource, which is `TaxFilingObject`.
The realizationModel defines only one template, which applies to all references. It
uses an inclusive property set, but excludes all primitive properties.
This should create a realization for `TaxFiling`, having only a reference to a `Person`
realization. The Person realization is an empty object, because it has no reference
properties; therefore all of its properties are excluded.
- RAPID Model
- InclusivePropertySet_ExcludePrimitive.rapid
- Assertions
-
``` ExcludePrimitive
model.tbTaxFilingObject.check [
named("TaxFiling_AllExceptPrimitive").selects("AllObjects")
withProps [
includingRef("taxpayer") [
named("Person_AllExceptPrimitive").selects("AllObjects")
withNoProps
]
checkedAll
]
]
```
### AllPropertiesExcludingReferences
- Description
-
The resourceAPI defines only one resource, which is `TaxFilingObject`.
The realizationModel defines only one template, which applies to all references. It
uses an inclusive property set, but excludes all reference properties.
This should create a realization for `TaxFiling`, having only primitive properties.
There should not be a realization for `Person`, because the `taxpayer` reference
property is excluded, so `Person` is unreachable.
- RAPID Model
- InclusivePropertySet_ExcludeReference.rapid
- Assertions
-
``` ExcludeReference
model.tbTaxFilingObject.check [
named("TaxFiling_AllExceptReference").selects("AllObjectRefsAsInlineObjects")
withOnlyProps("filingID", "jurisdiction", "year", "period", "currency", "grossIncome", "taxLiability")
]
```