Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }