Author: rolf
Date: 2008-01-19 06:26:12 -0500 (Sat, 19 Jan 2008)
New Revision: 93313

Modified:
   trunk/mcs/class/System/System.ComponentModel/ChangeLog
   trunk/mcs/class/System/System.ComponentModel/MaskedTextProvider.cs
   trunk/mcs/class/System/Test/System.ComponentModel/ChangeLog
   trunk/mcs/class/System/Test/System.ComponentModel/MaskedTextProviderTest.cs
Log:
* System.ComponentModel/MaskedTextProvider.cs,
  Test/System.ComponentModel/MaskedTextProviderTest.cs: Fix
  IsPassword (found by Gendarme)

Modified: trunk/mcs/class/System/System.ComponentModel/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.ComponentModel/ChangeLog      2008-01-19 
11:11:45 UTC (rev 93312)
+++ trunk/mcs/class/System/System.ComponentModel/ChangeLog      2008-01-19 
11:26:12 UTC (rev 93313)
@@ -1,3 +1,7 @@
+2008-01-19  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
+       * MaskedTextProvider.cs: Fix IsPassword (found by Gendarme)
+
 2008-01-07  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * CultureInfoConverter.cs: Gendarme's AvoidToStringOnStringsRule in

Modified: trunk/mcs/class/System/System.ComponentModel/MaskedTextProvider.cs
===================================================================
--- trunk/mcs/class/System/System.ComponentModel/MaskedTextProvider.cs  
2008-01-19 11:11:45 UTC (rev 93312)
+++ trunk/mcs/class/System/System.ComponentModel/MaskedTextProvider.cs  
2008-01-19 11:26:12 UTC (rev 93313)
@@ -1917,7 +1917,7 @@
                                return password_char != char.MinValue;
                        }
                        set {
-                               password_char = DefaultPasswordChar;
+                               password_char = value ? DefaultPasswordChar : 
char.MinValue;
                        }
                }
                

Modified: trunk/mcs/class/System/Test/System.ComponentModel/ChangeLog
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/ChangeLog 2008-01-19 
11:11:45 UTC (rev 93312)
+++ trunk/mcs/class/System/Test/System.ComponentModel/ChangeLog 2008-01-19 
11:26:12 UTC (rev 93313)
@@ -1,3 +1,7 @@
+2008-01-19  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
+       * MaskedTextProviderTest.cs: Fix IsPassword (found by Gendarme)
+
 2008-01-03  Gert Driesen  <[EMAIL PROTECTED]>
 
        * TypeDescriptorProperties.cs: added test for order of

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/MaskedTextProviderTest.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/MaskedTextProviderTest.cs 
2008-01-19 11:11:45 UTC (rev 93312)
+++ trunk/mcs/class/System/Test/System.ComponentModel/MaskedTextProviderTest.cs 
2008-01-19 11:26:12 UTC (rev 93313)
@@ -2006,6 +2006,19 @@
 
                }
                [Test]
+               public void IsPasswordTest () 
+               {
+                       MaskedTextProvider mtp = new MaskedTextProvider ("a");
+                       Assert.IsFalse (mtp.IsPassword, "#01");
+                       Assert.AreEqual (char.MinValue, mtp.PasswordChar, 
"#02");
+                       mtp.IsPassword = true;
+                       Assert.IsTrue (mtp.IsPassword, "#03");
+                       Assert.AreEqual ('*', mtp.PasswordChar, "#04");
+                       mtp.IsPassword = false;
+                       Assert.IsFalse (mtp.IsPassword, "#05");
+                       Assert.AreEqual (char.MinValue, mtp.PasswordChar, 
"#06");
+               }
+               [Test]
                [ExpectedException (typeof (ArgumentNullException))]
                public void 
Replace_string_int_int_MaskedTextResultHintTestException ()
                {
@@ -5514,4 +5527,4 @@
                /* END */
        }
 }
-#endif
\ No newline at end of file
+#endif

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

Reply via email to