public void StoreLicenseInLmCommandExecute_StoreLicenseForAllUsersWasSuccessful__ShowMessageWindow() { _uacAssistant.StoreLicenseForAllUsers(Arg.Any <string>(), Arg.Any <string>()).Returns(true); var title = ""; var text = ""; var options = MessageOptions.MoreInfoCancel; var icon = MessageIcon.None; var translation = new StoreLicenseForAllUsersWindowTranslation(); _interactionInvoker.When(x => x.Invoke(Arg.Any <MessageInteraction>())).Do(x => { var interaction = x[0] as MessageInteraction; title = interaction.Title; text = interaction.Text; options = interaction.Buttons; icon = interaction.Icon; }); _storeLicenseForAllUsersWindowViewModel.StoreLicenseInLmCommand.Execute(null); Assert.AreEqual(ProductName, title, "Title of message box is not the product name"); Assert.AreEqual(translation.StoreForAllUsersSuccessful, text, "Wrong text in message box"); Assert.AreEqual(MessageOptions.OK, options, "Wrong options in message box"); Assert.AreEqual(icon, MessageIcon.PDFCreator, "Wrong MessageBoxIcon"); }
public void StoreLicenseInLmCommandExecute_StoreLicenseForAllUsersWasSuccessful__ShowMessageWindow() { _uacAssistant.StoreLicenseForAllUsers(Arg.Any <string>(), Arg.Any <string>()).Returns(true); var translation = new StoreLicenseForAllUsersWindowTranslation(); _storeLicenseForAllUsersWindowViewModel.StoreLicenseInLmCommand.Execute(null); var interaction = _interactionRequest.AssertWasRaised <MessageInteraction>(); Assert.AreEqual(ApplicationNameWithEdition.ToUpper(), interaction.Title, "Title of message box is not the product name"); Assert.AreEqual(translation.StoreForAllUsersSuccessful, interaction.Text, "Wrong text in message box"); Assert.AreEqual(MessageOptions.OK, interaction.Buttons, "Wrong options in message box"); Assert.AreEqual(MessageIcon.PDFCreator, interaction.Icon, "Wrong MessageBoxIcon"); }
private void StoreLicenseInLmCommandExecute(object obj) { var success = _uacAssistant.StoreLicenseForAllUsers(Interaction.LicenseServerCode, Interaction.LicenseKey); if (success) { var text = Translation.StoreForAllUsersSuccessful; var interaction = new MessageInteraction(text, Title, MessageOptions.OK, MessageIcon.PDFCreator); _interactionRequest.Raise(interaction); } else { var text = Translation.StoreForAllUsersFailed; var interaction = new MessageInteraction(text, Title, MessageOptions.OK, MessageIcon.Error); _interactionRequest.Raise(interaction); } FinishInteraction(); }