2009-06-06 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / CommonDialogsTest.cs
index 4568b6619664f106005458301c2d2d5cd774c781..72d9ff3a035a37d57cb67e28f096345390c8e308 100644 (file)
@@ -38,7 +38,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Windows.Forms
 {
        [TestFixture]
-       public class CommonDialogsTest
+       public class CommonDialogsTest : TestHelper
        {
                OpenFileDialog ofd;
                SaveFileDialog sfd;
@@ -242,6 +242,21 @@ namespace MonoTests.System.Windows.Forms
                }
                
                [Test]
+               [NUnit.Framework.Category ("NotWorking")]
+               /* a few people have been seeing the following:
+Failures:
+1) MonoTests.System.Windows.Forms.CommonDialogsTest.FolderBrowserDialogTest : System.ArgumentException : oldValue is the empty string.
+  at System.String.Replace (System.String oldValue, System.String newValue) [0x00054] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/corlib/System/String.cs:1285 
+  at System.Windows.Forms.FolderBrowserDialog+FolderBrowserTreeView.SetSelectedPath (System.String path) [0x00061] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs:460 
+  at System.Windows.Forms.FolderBrowserDialog+FolderBrowserTreeView.set_SelectedPath (System.String value) [0x0000c] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs:363 
+  at (wrapper remoting-invoke-with-check) FolderBrowserTreeView:set_SelectedPath (string)
+  at System.Windows.Forms.FolderBrowserDialog.set_SelectedPath (System.String value) [0x0001a] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs:223 
+  at (wrapper remoting-invoke-with-check) System.Windows.Forms.FolderBrowserDialog:set_SelectedPath (string)
+  at MonoTests.System.Windows.Forms.CommonDialogsTest.FolderBrowserDialogTest () [0x00094] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/CommonDialogsTest.cs:260 
+  at <0x00000> <unknown method>
+  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[])
+  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00040] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/corlib/System.Reflection/MonoMethod.cs:143 
+               */
                public void FolderBrowserDialogTest ()
                {
                        fbd = new FolderBrowserDialog ();
@@ -270,6 +285,33 @@ namespace MonoTests.System.Windows.Forms
                        
                        fbd.RootFolder = (Environment.SpecialFolder)12;
                }
+
+#if NET_2_0
+               [Test]
+               public void CommonDialogPropertyTag ()
+               {
+                       MyDialog md = new MyDialog ();
+                       object s = "MyString";
+                       
+                       Assert.AreEqual (null, md.Tag, "A1");
+                       
+                       md.Tag = s;
+                       Assert.AreSame (s, md.Tag, "A2");
+               }
+               
+               private class MyDialog : CommonDialog
+               {
+                       public override void Reset ()
+                       {
+                               throw new Exception ("The method or operation is not implemented.");
+                       }
+
+                       protected override bool RunDialog (IntPtr hwndOwner)
+                       {
+                               throw new Exception ("The method or operation is not implemented.");
+                       }
+               }
+#endif
        }
 }