Author: gert
Date: 2008-02-02 15:00:59 -0500 (Sat, 02 Feb 2008)
New Revision: 94651

Added:
   trunk/gert/interactive/bug353310/
   trunk/gert/interactive/bug353310/MainForm.cs
   trunk/gert/interactive/bug353310/default.build
Modified:
   trunk/gert/interactive/known-issues
Log:
Added test for bug #353310.


Added: trunk/gert/interactive/bug353310/MainForm.cs
===================================================================
--- trunk/gert/interactive/bug353310/MainForm.cs        2008-02-02 19:55:42 UTC 
(rev 94650)
+++ trunk/gert/interactive/bug353310/MainForm.cs        2008-02-02 20:00:59 UTC 
(rev 94651)
@@ -0,0 +1,148 @@
+using System;
+using System.Drawing;
+using System.ComponentModel;
+using System.Globalization;
+using System.Windows.Forms;
+
+class MainForm : Form
+{
+       public MainForm ()
+       {
+               // 
+               // _nameLabel
+               // 
+               _nameLabel = new Label ();
+               _nameLabel.AutoSize = true;
+               _nameLabel.Location = new Point (8, 8);
+               _nameLabel.Text = "Name:";
+               Controls.Add (_nameLabel);
+               // 
+               // _nameValue
+               // 
+               _nameValue = new TextBox ();
+               _nameValue.Location = new Point (80, 8);
+               _nameValue.Size = new Size (120, 20);
+               _nameValue.Validating += new CancelEventHandler 
(NameValue_Validating);
+               Controls.Add (_nameValue);
+               // 
+               // 
+               // 
+               _quitButton = new Button ();
+               _quitButton.Location = new Point (230, 8);
+               _quitButton.Size = new Size (60, 20);
+               _quitButton.Text = "Quit";
+               _quitButton.Click += new EventHandler (QuitButton_Click);
+               Controls.Add (_quitButton);
+               // 
+               // MainForm
+               // 
+               ClientSize = new Size (300, 50);
+               Location = new Point (250, 100);
+               StartPosition = FormStartPosition.Manual;
+               Text = "bug #353310";
+               Closing += new CancelEventHandler (MainForm_Closing);
+       }
+
+       [STAThread]
+       static void Main ()
+       {
+               Application.Run (new MainForm ());
+       }
+
+       void MainForm_Closing (object sender, CancelEventArgs e)
+       {
+               if (e.Cancel) {
+                       MessageBox.Show ("Allowing application to quit...", 
"bug #353310");
+                       e.Cancel = false;
+               }
+       }
+
+       void QuitButton_Click (object sender, EventArgs e)
+       {
+               Close ();
+       }
+
+       void NameValue_Validating (object sender, CancelEventArgs e)
+       {
+               if (_nameValue.Text.Length == 0) {
+                       MessageBox.Show ("Please enter a name.", "bug #353310");
+                       e.Cancel = true;
+               }
+       }
+
+       private Label _nameLabel;
+       private TextBox _nameValue;
+       private Button _quitButton;
+}
+
+public class InstructionsForm : Form
+{
+       public InstructionsForm ()
+       {
+               // 
+               // _tabControl
+               // 
+               _tabControl = new TabControl ();
+               _tabControl.Dock = DockStyle.Fill;
+               Controls.Add (_tabControl);
+               // 
+               // _bugDescriptionText1
+               // 
+               _bugDescriptionText1 = new TextBox ();
+               _bugDescriptionText1.Dock = DockStyle.Fill;
+               _bugDescriptionText1.Multiline = true;
+               _bugDescriptionText1.Text = string.Format 
(CultureInfo.InvariantCulture,
+                       "Steps to execute:{0}{0}" +
+                       "1. Do not enter any text in the textbox.{0}{0}" +
+                       "2. Click the Quit button.{0}{0}" +
+                       "Expected result:{0}{0}" +
+                       "1. A message box with the following text is 
displayed:{0}{0}" +
+                       "   * Please enter a name.{0}{0}" +
+                       "2. The Name textbox has focus.{0}{0}" +
+                       "3. The Quit button is in the \"unpressed\" state.",
+                       Environment.NewLine);
+               // 
+               // _tabPage1
+               // 
+               _tabPage1 = new TabPage ();
+               _tabPage1.Text = "#1";
+               _tabPage1.Controls.Add (_bugDescriptionText1);
+               _tabControl.Controls.Add (_tabPage1);
+               // 
+               // _bugDescriptionText2
+               // 
+               _bugDescriptionText2 = new TextBox ();
+               _bugDescriptionText2.Dock = DockStyle.Fill;
+               _bugDescriptionText2.Multiline = true;
+               _bugDescriptionText2.Text = string.Format 
(CultureInfo.InvariantCulture,
+                       "Steps to execute:{0}{0}" +
+                       "1. Do not enter any text in the textbox.{0}{0}" +
+                       "2. Use the control box to close the form.{0}{0}" +
+                       "Expected result:{0}{0}" +
+                       "1. Two message boxes with the following text are 
displayed:{0}{0}" +
+                       "   * Please enter a name.{0}" +
+                       "   * Allowing application to quit...{0}{0}" +
+                       "2. The application exits.",
+                       Environment.NewLine);
+               // 
+               // _tabPage2
+               // 
+               _tabPage2 = new TabPage ();
+               _tabPage2.Text = "#2";
+               _tabPage2.Controls.Add (_bugDescriptionText2);
+               _tabControl.Controls.Add (_tabPage2);
+               // 
+               // InstructionsForm
+               // 
+               ClientSize = new Size (300, 200);
+               Location = new Point (600, 100);
+               StartPosition = FormStartPosition.Manual;
+               Text = "Instructions - bug #353310";
+       }
+
+       private TextBox _bugDescriptionText1;
+       private TextBox _bugDescriptionText2;
+       private TabControl _tabControl;
+       private TabPage _tabPage1;
+       private TabPage _tabPage2;
+}


Property changes on: trunk/gert/interactive/bug353310/MainForm.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/interactive/bug353310/default.build
===================================================================
--- trunk/gert/interactive/bug353310/default.build      2008-02-02 19:55:42 UTC 
(rev 94650)
+++ trunk/gert/interactive/bug353310/default.build      2008-02-02 20:00:59 UTC 
(rev 94651)
@@ -0,0 +1,31 @@
+<project name="bug353310" default="rebuild">
+       <include buildfile="../../build/common.build" />
+       
+       <property name="frameworks" value="mono-1.0,mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="compile" depends="init">
+               <csc target="winexe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="MainForm.cs" />
+                       </sources>
+                       <references>
+                               <include name="System.Drawing.dll" />
+                               <include name="System.Windows.Forms.dll" />
+                       </references>
+               </csc>
+       </target>
+
+       <target name="run-test" depends="compile">
+               <exec program="test.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}" />
+       </target>
+</project>


Property changes on: trunk/gert/interactive/bug353310/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/gert/interactive/known-issues
===================================================================
--- trunk/gert/interactive/known-issues 2008-02-02 19:55:42 UTC (rev 94650)
+++ trunk/gert/interactive/known-issues 2008-02-02 20:00:59 UTC (rev 94651)
@@ -122,6 +122,7 @@
 bug343364/**
 bug345883/**
 bug351938/**
+bug353310/**
 bug356527/**
 bug356530/**
 bug357638/**

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to