ButtonTest.cs, ImageListTest.cs, ControlEventTest.cs, LabelPropertyTest.cs, CheckBoxT...
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / ImageListTest.cs
1 //
2 // ImageImageListTest.cs: Test cases for ImageImageList.
3 //
4 // Author:
5 //   Ritvik Mayank (mritvik@novell.com)
6 //
7 // (C) 2005 Novell, Inc. (http://www.novell.com)
8 //
9
10 using System;
11 using System.Windows.Forms;
12 using System.Drawing;
13 using System.Reflection;
14 using NUnit.Framework;
15
16 namespace MonoTests.System.Windows.Forms
17 {
18         [TestFixture]
19         public class ImageListTest
20         {
21                 [Test]
22                 public void ImageListPropertyTest ()
23                 {
24                         Form myform = new Form ();
25                         ImageList myimagelist = new ImageList ();
26                         Assert.AreEqual (ColorDepth.Depth8Bit, myimagelist.ColorDepth, "#1");
27                         myimagelist.ColorDepth = ColorDepth.Depth32Bit;
28                         Assert.AreEqual (false, myimagelist.HandleCreated, "#2");
29                         myimagelist.Handle.ToInt32 ();
30                         Assert.AreEqual (true, myimagelist.HandleCreated, "#3");
31                         Assert.AreEqual (ColorDepth.Depth32Bit, myimagelist.ColorDepth, "#4");
32                         Assert.AreEqual ("System.IntPtr", myimagelist.Handle.GetType ().FullName, "#5");
33                         Assert.AreEqual (0, myimagelist.Images.Count, "#6");
34                         Image myImage = Image.FromFile("M.gif");
35                         myimagelist.Images.Add (myImage);
36                         Assert.AreEqual (1, myimagelist.Images.Count, "#7");
37                         Assert.AreEqual (16, myimagelist.ImageSize.Height, "#8");
38                         Assert.AreEqual (16, myimagelist.ImageSize.Width, "#9");
39                         Assert.AreEqual (Color.Transparent, myimagelist.TransparentColor, "#10");
40                 }
41         }
42 }