public void CallculateDialogResultTest() { TestModalDialog dialog = new TestModalDialog(); dialog.SetButtons(DialogButtons.Okay); Assert.AreEqual(DialogResult.Okay, dialog.CallCalculateDialogResult(DialogButton.Button1)); dialog.SetButtons(DialogButtons.OkayCancel); Assert.AreEqual(DialogResult.Okay, dialog.CallCalculateDialogResult(DialogButton.Button1)); Assert.AreEqual(DialogResult.Cancel, dialog.CallCalculateDialogResult(DialogButton.Button2)); dialog.SetButtons(DialogButtons.YesNo); Assert.AreEqual(DialogResult.Yes, dialog.CallCalculateDialogResult(DialogButton.Button1)); Assert.AreEqual(DialogResult.No, dialog.CallCalculateDialogResult(DialogButton.Button2)); dialog.SetButtons(DialogButtons.YesNoCancel); Assert.AreEqual(DialogResult.Yes, dialog.CallCalculateDialogResult(DialogButton.Button1)); Assert.AreEqual(DialogResult.No, dialog.CallCalculateDialogResult(DialogButton.Button2)); Assert.AreEqual(DialogResult.Cancel, dialog.CallCalculateDialogResult(DialogButton.Button3)); }
public void ButtonVisibilityTest() { TestModalDialog dialog = new TestModalDialog(); dialog.SetButtons(DialogButtons.Okay); Assert.IsFalse(dialog.GetSecondButtonVisible()); Assert.IsFalse(dialog.GetThirdButtonVisible()); dialog.SetButtons(DialogButtons.OkayCancel); Assert.IsTrue(dialog.GetSecondButtonVisible()); Assert.IsFalse(dialog.GetThirdButtonVisible()); dialog.SetButtons(DialogButtons.YesNo); Assert.IsTrue(dialog.GetSecondButtonVisible()); Assert.IsFalse(dialog.GetThirdButtonVisible()); dialog.SetButtons(DialogButtons.YesNoCancel); Assert.IsTrue(dialog.GetSecondButtonVisible()); Assert.IsTrue(dialog.GetThirdButtonVisible()); }
public void ButtonTextTest() { TestModalDialog dialog = new TestModalDialog(); dialog.SetButtons(DialogButtons.Okay); Assert.AreEqual(Messages.Okay, dialog.GetFirstButtonText()); Assert.IsTrue(string.IsNullOrEmpty(dialog.GetSecondButtonText())); Assert.IsTrue(string.IsNullOrEmpty(dialog.GetThirdButtonText())); dialog.SetButtons(DialogButtons.OkayCancel); Assert.AreEqual(Messages.Okay, dialog.GetFirstButtonText()); Assert.AreEqual(Messages.Cancel, dialog.GetSecondButtonText()); Assert.IsTrue(string.IsNullOrEmpty(dialog.GetThirdButtonText())); dialog.SetButtons(DialogButtons.YesNo); Assert.AreEqual(Messages.Yes, dialog.GetFirstButtonText()); Assert.AreEqual(Messages.No, dialog.GetSecondButtonText()); Assert.IsTrue(string.IsNullOrEmpty(dialog.GetThirdButtonText())); dialog.SetButtons(DialogButtons.YesNoCancel); Assert.AreEqual(Messages.Yes, dialog.GetFirstButtonText()); Assert.AreEqual(Messages.No, dialog.GetSecondButtonText()); Assert.AreEqual(Messages.Cancel, dialog.GetThirdButtonText()); }