public void Creating_MessageBox_With_Duplicate_Key_Should_Return_The_Same_One() { var msg1 = FAMessageBoxManager.CreateMessageBox("Test"); var msg2 = FAMessageBoxManager.CreateMessageBox("Test"); Assert.AreEqual(msg1, msg2); Assert.AreSame(msg1, msg2); }
public void Get_Message_Box_Should_Return_Null_When_Key_Not_Found() { var msg = FAMessageBoxManager.CreateMessageBox("Test"); FAMessageBoxManager.DeleteMessageBox("Test"); var msg2 = FAMessageBoxManager.GetMessageBox("Test"); Assert.Null(msg2); }
public void Creating_MessageBox_With_Duplicate_Key_Should_Return_Another_One_When_Disposed() { var msg = FAMessageBoxManager.CreateMessageBox("Test"); ((IDisposable)msg).Dispose(); Assert.True(msg.IsDisposed); msg = FAMessageBoxManager.CreateMessageBox("Test"); Assert.False(msg.IsDisposed); }
public void Delete_NonExisting_MessageBox() { var msgboxName = Guid.NewGuid().ToString(); var result = FAMessageBoxManager.DeleteMessageBox(msgboxName); Assert.False(result); FAMessageBoxManager.CreateMessageBox(msgboxName); result = FAMessageBoxManager.DeleteMessageBox(msgboxName); Assert.True(result); }
private void button1_Click(object sender, EventArgs e) { FAMessageBox msg; msg = FAMessageBoxManager.GetMessageBox(DEF_BASIC_MESSAGEBOX); if (FAMessageBoxManager.GetMessageBox(DEF_BASIC_MESSAGEBOX) == null) { msg = FAMessageBoxManager.CreateMessageBox(DEF_BASIC_MESSAGEBOX, true); msg.AddButtons(MessageBoxButtons.YesNo); } msg.AllowSaveResponse = true; msg.SaveResponseText = "سوال را تکرار نکن"; msg.Text = "ایا موافق هستید"; msg.Caption = "سوال"; msg.Icon = FarsiMessageBoxExIcon.Exclamation; msg.PlaySound = true; string value = msg.Show(); lblMessage.Text = string.Format("You've selected {0} in Basic MessageBox.", value); }
private void btnCustom_Click(object sender, EventArgs e) { FAMessageBox msg; msg = FAMessageBoxManager.GetMessageBox(DEF_ADVBUTTON_MESSAGEBOX); if (FAMessageBoxManager.GetMessageBox(DEF_ADVBUTTON_MESSAGEBOX) == null) { msg = FAMessageBoxManager.CreateMessageBox(DEF_ADVBUTTON_MESSAGEBOX); msg.AddButton(new FAMessageBoxButton("Yes", "YES")); msg.AddButton(new FAMessageBoxButton("No", "NO")); msg.AddButton(new FAMessageBoxButton("Yes To All", "YESTOALL")); msg.AddButton(new FAMessageBoxButton("No To All", "NOTOALL")); } msg.AllowSaveResponse = true; msg.SaveResponseText = "Don't ask this question again."; msg.Text = "This file already exists. Overwrite?"; msg.Icon = FarsiMessageBoxExIcon.Question; string value = msg.Show(this); lblMessage.Text = string.Format("You've selected {0} in Advanced MessageBox.", value); }
public void Should_Specify_MessageBox_Name_When_Creating_One() { Assert.Throws(typeof(InvalidOperationException), () => FAMessageBoxManager.CreateMessageBox(string.Empty)); }