BHoM / Test_Toolkit

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

IsValidQuantityInputAttribute check will always be true #297

Closed pawelbaran closed 3 years ago

pawelbaran commented 3 years ago

Description:

The loop below checks whether the strongly typed property contains an object of that certain type, which will always be true. https://github.com/BHoM/Test_Toolkit/blob/ed6ffad8d1949b72147a4c98b4c5f87b0ffa9683/CodeComplianceTest_Engine/Query/DynamicChecks/IsValidQuantityInputAttribute.cs#L42-L49

As discussed with @IsakNaslundBh, it may be hard to effectively test this one as the property will simply stay equal to null in case its constructor gets fed with wrong type.

https://github.com/BHoM/BHoM/blob/49b56b2370b198591cbf371ea7f230ca374d27f8/Reflection_oM/Attributes/InputAttribute.cs#L47-L55

FraserGreenroyd commented 3 years ago

Yes this is by design, this particular check is within the Dynamic section and is still in prototype phase. It had to be updated in order to compile, but currently does as its designed for now :smile: