All implementations of IStrategy
should test input cells are not modified
#10
Labels
testing
There are missing test cases
Currently we're using
bool?[]
to represent cells, but passed asIEnumerable<bool?>. It would be possible for an implementation of
IStrategyto cast this to the specific type and fiddle with the content. We do not want to allow this. Managing the state of any grid would be the responsibility of any kind of
Gameor
Puzzle` type, not the strategy itself.It might make sense to implement this behaviour in
StrategyBase
. That type could take a copy of the input array and pass that to the template method. That would guarantee inheritors cannot modify the original because they never see it. That way we only have to implement the tests for one type, rather than every implementation.This might become a non-issue if we implement
Line
(#1) andHint
(#2); we'd expect to implement those as immutable types so implementations ofIStrategy
would have a hard time changing them 😉The text was updated successfully, but these errors were encountered: