Testing SimpleCommand

Oct 19, 2011 at 2:38 PM

Hi

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?

 

Thanks

Coordinator
Oct 19, 2011 at 3: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 10:14 AM

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

Coordinator
Oct 24, 2011 at 8:43 AM

No worries