public void Remove_CanExecuteAllCommands() { var vm = new EncryptionPasswordViewModelwithRemove(); Assert.IsTrue(vm.OkCommand.IsExecutable, "OK Command ist not executable"); Assert.IsTrue(vm.RemoveCommand.IsExecutable, "Skip Command is not executable"); Assert.IsTrue(vm.SkipCommand.IsExecutable, "SkipCommand is not executable"); }
public void Remove_CheckDialogResultInCloseActionForRemoveCommand() { var vm = new EncryptionPasswordViewModelwithRemove(); vm.CloseViewAction = CloseAction; vm.RemoveCommand.Execute(null); Assert.AreEqual(_closeDialogResult, true, "Wrong DialogResult for Remove command"); }
public void Remove_CheckResponses() { var vm = new EncryptionPasswordViewModelwithRemove(); vm.OkCommand.Execute(null); Assert.AreEqual(EncryptionPasswordResponse.OK, vm.Response, "Wrong Response for OkCommand"); vm.RemoveCommand.Execute(null); Assert.AreEqual(EncryptionPasswordResponse.Remove, vm.Response, "Wrong Response for RemoveCommand"); vm.SkipCommand.Execute(null); Assert.AreEqual(EncryptionPasswordResponse.Skip, vm.Response, "Wrong Response for SkipCommand"); }
public void Remove_ExecuteSkip_PasswordsAreEmpty() { var vm = new EncryptionPasswordViewModelwithRemove(true); vm.OwnerPassword = "******"; vm.UserPassword = "******"; vm.RemoveCommand.Execute(null); Assert.IsEmpty(vm.OwnerPassword, "OwnerPassword is not empty after removing."); Assert.IsEmpty(vm.UserPassword, "UserPassword is not empty after removing."); }
public void Remove_ExecuteOk_PasswordsAreTheSettedPasswords() { var vm = new EncryptionPasswordViewModelwithRemove(true); vm.OwnerPassword = "******"; vm.UserPassword = "******"; vm.OkCommand.Execute(null); Assert.AreEqual("ownerpw", vm.OwnerPassword, "OwnerPassword is not setted password."); Assert.AreEqual("userpw", vm.UserPassword, "UserPassword is not setted password."); }
public EncryptionPasswordsWindow(EncryptionPasswordMiddleButton middleButton, bool askOwnerPassword, bool askUserPassword) { Loaded += (sender, e) => MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); InitializeComponent(); switch (middleButton) { case EncryptionPasswordMiddleButton.Skip: DataContext = new EncryptionPasswordViewModelwithSkip(askOwnerPassword, askUserPassword); RemoveButton.Visibility = Visibility.Collapsed; PasswordHintText.Visibility = Visibility.Collapsed; break; default: DataContext = new EncryptionPasswordViewModelwithRemove(askUserPassword); SkipButton.Visibility = Visibility.Collapsed; break; } EncryptionPasswordViewModel.CloseViewAction = delegate(bool?result) { DialogResult = result; }; }
public void Remove_WithoutAskUserPassword_DoesNotRequireUserPassword() { var vm = new EncryptionPasswordViewModelwithRemove(false); Assert.IsFalse(vm.AskUserPassword); }
public void Remove_WithAskUserPassword_RequiresUserPassword() { var vm = new EncryptionPasswordViewModelwithRemove(true); Assert.IsTrue(vm.AskUserPassword); }
public void Remove_InitTest() { var vm = new EncryptionPasswordViewModelwithRemove(); Assert.AreEqual(vm.Response, EncryptionPasswordResponse.Cancel); }