1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
//
// ToolTipTest.cs: Test cases for ToolTip.
//
// Author:
// Ritvik Mayank (mritvik@novell.com)
//
// (C) 2005 Novell, Inc. (http://www.novell.com)
//
using System;
using NUnit.Framework;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.Remoting;
namespace MonoTests.System.Windows.Forms
{
[TestFixture]
public class ToolTipTest
{
[Test]
public void ToolTipPropertyTest ()
{
ToolTip myToolTip = new ToolTip ();
// A
Assert.AreEqual (true, myToolTip.Active, "#A1");
Assert.AreEqual (5000, myToolTip.AutoPopDelay, "#A2");
Assert.AreEqual (5000, myToolTip.AutoPopDelay, "#A3");
// I
Assert.AreEqual (500, myToolTip.InitialDelay, "#I1");
// R
Assert.AreEqual (100, myToolTip.ReshowDelay, "#R1");
// S
Assert.AreEqual (false, myToolTip.ShowAlways, "#S1");
}
[Test]
public void GetAndSetToolTipTest ()
{
ToolTip myToolTip = new ToolTip ();
Button myButton = new Button ();
myToolTip.ShowAlways = true;
myToolTip.SetToolTip (myButton, "My Button");
string myString = myToolTip.GetToolTip (myButton);
Assert.AreEqual ("My Button", myString, "#Mtd1");
}
[Test]
public void RemoveToolTipTest ()
{
ToolTip myToolTip = new ToolTip ();
Button myButton = new Button ();
myToolTip.ShowAlways = true;
myToolTip.SetToolTip (myButton, "My Button");
myToolTip.RemoveAll ();
Assert.AreEqual ("", myToolTip.GetToolTip (myButton), "#Mtd2");
}
[Test]
public void ToStringTest ()
{
ToolTip myToolTip = new ToolTip ();
Assert.AreEqual ("System.Windows.Forms.ToolTip InitialDelay: 500, ShowAlways: False", myToolTip.ToString (), "#Mtd3");
}
}
}
|