When using a custom ICommandCreator to integrate an IOC container, the display of the help for a command fails due to the fact that Model/Option classes may not have parameterless constructors but Activator.CreateInstance is being used.
This change uses ICommandCreator whenver an object needs to be created so that IOC can participate. All calls to Activator.CreateInstance are limited to the ActivatorCommandCreator.
Due to the return type of IOaktonCommand in the existing ICommandCreator method, I added a second method which is used for non-command objects. I am not wild about this design but I didn't want to change ICommandCreator into a full blown IOC abstraction.
I am also looking for more feedback and guidance on the unit tests. I am not sure the best way to isolate the scenario of building the help for a command.
When using a custom
ICommandCreator
to integrate an IOC container, the display of the help for a command fails due to the fact that Model/Option classes may not have parameterless constructors butActivator.CreateInstance
is being used.This change uses
ICommandCreator
whenver an object needs to be created so that IOC can participate. All calls toActivator.CreateInstance
are limited to theActivatorCommandCreator
.Due to the return type of
IOaktonCommand
in the existingICommandCreator
method, I added a second method which is used for non-command objects. I am not wild about this design but I didn't want to changeICommandCreator
into a full blown IOC abstraction.I am also looking for more feedback and guidance on the unit tests. I am not sure the best way to isolate the scenario of building the help for a command.