2005-11-16 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Wed, 16 Nov 2005 18:54:27 +0000 (18:54 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Wed, 16 Nov 2005 18:54:27 +0000 (18:54 -0000)
* TimersDescriptionAttributeCas.cs: Updated comments (thanks to Gert
Driesen for the solution).
* TimersDescriptionAttributeTest.cs: New. Unit tests to show that the
description string is a resource name (and not the description itself)

svn path=/trunk/mcs/; revision=53138

mcs/class/System/Test/System.Timers/ChangeLog
mcs/class/System/Test/System.Timers/TimersDescriptionAttributeCas.cs
mcs/class/System/Test/System.Timers/TimersDescriptionAttributeTest.cs [new file with mode: 0644]

index 91c6454e78acd1ec68d140bb2b925411a16bb2cb..11f8bd8c1312a6812fbcbfc4fa03fc9d19d24c52 100644 (file)
@@ -1,3 +1,10 @@
+2005-11-16  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * TimersDescriptionAttributeCas.cs: Updated comments (thanks to Gert
+       Driesen for the solution).
+       * TimersDescriptionAttributeTest.cs: New. Unit tests to show that the
+       description string is a resource name (and not the description itself)
+
 2005-11-16  Sebastien Pouliot  <sebastien@ximian.com> 
  
        * TimersDescriptionAttributeCas.cs: Fixed test as the Description
index 2da2fd53900089f0c6806a7a982b15494bbc992f..08b35c432480e23c89508c292632d40ae34c9e70 100644 (file)
@@ -53,9 +53,7 @@ namespace MonoCasTests.System.Timers {
                public void Constructor_Deny_Unrestricted ()
                {
                        TimersDescriptionAttribute tda = new TimersDescriptionAttribute ("Mono");
-                       // note: in the unit tests MS always (1.x and 2.0) return null
-                       // but when "created" indirectly (e.g. corcompare) the real value is returned
-                       // note: Mono always return the value
+                       // Note: see unit tests for why we're not expecting "Mono" as the value
                        Assert.AreEqual (tda.Description, tda.Description, "Description");
                        // this assert doesn't do anything (except removing warning) but we know,
                        // for CAS, that nothing protects the property getter
diff --git a/mcs/class/System/Test/System.Timers/TimersDescriptionAttributeTest.cs b/mcs/class/System/Test/System.Timers/TimersDescriptionAttributeTest.cs
new file mode 100644 (file)
index 0000000..66be0ab
--- /dev/null
@@ -0,0 +1,57 @@
+//
+// TimersDescriptionAttributeTest.cs 
+//     - Unit tests for System.Timers.TimersDescriptionAttribute
+//
+// Author:
+//     Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Timers;
+
+namespace MonoTests.System.Timers {
+
+       [TestFixture]
+       public class TimersDescriptionAttributeTest {
+
+               [Test]
+               [Category ("NotWorking")]
+               public void AnyString ()
+               {
+                       TimersDescriptionAttribute tda = new TimersDescriptionAttribute ("Mono");
+                       Assert.IsNull (tda.Description, "Description");
+               }
+
+               [Test]
+               [Category ("NotWorking")]
+               public void ExistingResourceName ()
+               {
+                       TimersDescriptionAttribute tda = new TimersDescriptionAttribute ("TimerEnabled");
+                       Assert.IsNotNull (tda.Description, "Description");
+                       Assert.IsFalse ("TimerEnabled" == tda.Description, "!Equal");
+               }
+       }
+}