I am trying to create a unit test where one of my templates has a member details that is typed as
template Record
with
...
details : RecordDetails
...
data RecordDetails
= SaleRecord SaleRecordDetails
| OfferRecord OfferRecordDetails
...
data SaleRecordDetails = SaleRecordDetails
with
...
price : Decimal
In my test case, I want to be able to do a check like:
...
pure (product.price == record.details.price)
I get the error:
No instance for (DA.Internal.Record.HasField “price”…
How can I tell the scenario that the record should have details as SaleRecordDetails? I am receiving my Record object from a choice that creates the Record as a SaleRecord.
Thanks again for the help!