* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Drawing / Test / System.Drawing / TestSize.cs
index 7cfa2c7db044b629a329d444f5d5c75496fbc473..675d4f483e429cef1d565738a85310a674b925ee 100644 (file)
@@ -2,16 +2,40 @@
 //
 // Author: Ravindra (rkumar@novell.com)
 //
-// Copyright (c) 2004 Novell, Inc.
+
+//
+// Copyright (C) 2004 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.Drawing;
+using System.Security.Permissions;
 
 namespace MonoTests.System.Drawing 
 {
-       [TestFixture]   
+       [TestFixture]
+       [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
        public class SizeTest : Assertion 
        {
                Size sz1_1;
@@ -159,6 +183,36 @@ namespace MonoTests.System.Drawing
 
                        AssertEquals ("SZ2SF#1", sf1, sf2);
                }
+
+               [Test]
+               public void ToStringTest ()
+               {
+                       AssertEquals ("{Width=1, Height=0}", sz1_0.ToString ());
+                       AssertEquals ("{Width=0, Height=0}", Size.Empty.ToString ());
+               }
+
+               [Test]
+               public void GetHashCodeTest ()
+               {
+                       AssertEquals (new Size (1, 0).GetHashCode (), sz1_0.GetHashCode ());
+               }
+
+#if NET_2_0
+               [Test]
+               public void AddTest ()
+               {
+                       AssertEquals ("ADD#1", sz1_1, Size.Add (sz1_0, sz0_1));
+                       AssertEquals ("ADD#2", sz1_1, Size.Add (sz1_1, new Size (0, 0)));
+               }
+
+               [Test]
+               public void SubtractTest ()
+               {
+                       AssertEquals ("SUB#1", sz1_0, Size.Subtract (sz1_1, sz0_1));
+                       AssertEquals ("SUB#2", sz0_1, Size.Subtract (sz1_1, sz1_0));    
+               }
+#endif
+
        }
 }