BHoM / BHoM_Adapter

GNU Lesser General Public License v3.0
7 stars 6 forks source link

Structure_AdapterModules: ModuleLoader is not independant of call order in adapter constructor #357

Closed IsakNaslundBh closed 1 year ago

IsakNaslundBh commented 1 year ago

Description:

As highlighted here

https://github.com/BHoM/ETABS_Toolkit/pull/422#pullrequestreview-1330130615

There is an issue with the copy-ropery-modules depending on the order that the moduleLoader is called and that the AdapterId assignment is done.

THis can be fixed by storing the adapter on the module rather than the ID type, and then simply use the ID type from the adapter when trying to access the Ids.

Steps to reproduce:

Define the AdapterIdType after the ModuleLoader is run in the constructor of the adapter

Expected behaviour:

For order of these actions to not matter

Test file(s):

Will update the StructuralAdapter in the test project to this reversed order and use existing tests (that som should fail with this change)