public void EditAccount_UserCancelsInteraction_CurrentAccountRemainsUnchanged() { var currentAccountCopy = _currentTimeServerAccount.Copy(); _interactionRequest.RegisterInteractionHandler <TimeServerAccountInteraction>(i => { i.TimeServerAccount.UserName = "******"; // User makes changes i.Success = false; // User cancels }); _timeServerAccountEditCommand.Execute(_currentTimeServerAccount); Assert.AreEqual(_currentTimeServerAccount, currentAccountCopy); }
public override void Execute(object parameter) { _currentAccount = parameter as TimeServerAccount; if (_currentAccount == null) { return; } if (!TimeServerAccounts.Contains(_currentAccount)) { return; } var interaction = new TimeServerAccountInteraction(_currentAccount.Copy(), Translation.EditTimeServerAccount); _interactionRequest.Raise(interaction, UpdateTimeServerAccountsCallback); }