Testing SimpleCommand

Oct 19, 2011 at 1:38 PM


In Cinch V1 the SimpleCommand could be tested by calling 'SimpleCommand.Execute(null) and then comparing the value of 'SimpleCommand.CommandSucceeded'. In Cinch V2 the 'CommandSucceeded' property appears to have been removed.

How should SimpleCommands be tested now?



Oct 19, 2011 at 2:30 PM

I decided since Commands do stuff, you should really be testing what the command did. For example if a SaveCommand saves the ViewModel data, you should check the ViewModel data is saved.

The CommandSucceeded really only ensured the command ran to completion, it did not guarantee it did the correct thing, I thought it was inconsistent so removed it. Hope you see what I mean

Oct 21, 2011 at 9:14 AM

That's fair enough, thanks for clearing that up :)

Oct 24, 2011 at 7:43 AM

No worries