You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are really 2 possibilities that this method decides:
Show a modal (e.g. enter a string)
Show an 'editor' (e.g. PosEditor)
This is hard to test and getting too big.
Possible Solutions
Add a shared interface for all editors INewValueGetter (PosEditor, SizeEditor etc)
Create a new class PropertyValueFactory with function Create that takes a Design, Property and oldValue then returns an INewValueGetter.
This will allow for unit testing that the correct decisions about what editor should be shown to be written and move the logic of this tree into its own class.
Advantages
In #271 I have started down the route of a more complex ArrayEditor. Having this logic in its own class would make it possible to centralize 'new value' logic.
Testability
Automation style of tests e.g. mocking INewValueGetter with test implementations that simulate the user driving editor to create a given value.
The text was updated successfully, but these errors were encountered:
We have logic that answers the following question:
oldValue
out
the new valueThis is that method:
There are really 2 possibilities that this method decides:
This is hard to test and getting too big.
Possible Solutions
Add a shared interface for all editors
INewValueGetter
(PosEditor
,SizeEditor
etc)Create a new class
PropertyValueFactory
with functionCreate
that takes aDesign
,Property
andoldValue
then returns anINewValueGetter
.This will allow for unit testing that the correct decisions about what editor should be shown to be written and move the logic of this tree into its own class.
Advantages
In #271 I have started down the route of a more complex ArrayEditor. Having this logic in its own class would make it possible to centralize 'new value' logic.
Testability
Automation style of tests e.g. mocking
INewValueGetter
with test implementations that simulate the user driving editor to create a given value.The text was updated successfully, but these errors were encountered: