Пример #1
0
	    public void ImeModeChangedChangedEventsOrder ()
	       {
		       string[] EventsWanted = {
			       "OnHandleCreated",
				 "OnBindingContextChanged",
				 "OnBindingContextChanged",
				 "OnImeModeChanged"
		       };
		       Form myform = new Form ();
		       myform.ShowInTaskbar = false;
		       myform.Visible = true;
		       MyScrollBar s = new MyScrollBar ();
		       myform.Controls.Add (s);
		       s.ImeMode = ImeMode.Katakana;

		       Assert.AreEqual (EventsWanted, ArrayListToString (s.Results));
		       myform.Dispose ();
	       }
Пример #2
0
	    public void BackgroundImageChangedEventsOrder ()
	       {
		       string[] EventsWanted = {
			       "OnHandleCreated",
				 "OnBindingContextChanged",
				 "OnBindingContextChanged",
				 "OnBackgroundImageChanged",
				 "OnInvalidated"
		       };
		       Form myform = new Form ();
		       myform.ShowInTaskbar = false;
		       myform.Visible = true;
		       MyScrollBar s = new MyScrollBar ();
		       myform.Controls.Add (s);
		       s.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");

		       Assert.AreEqual (EventsWanted, ArrayListToString (s.Results));
		       myform.Dispose ();
	       }
Пример #3
0
	    public void ForeColorChangedEventsOrder ()
	       {
		       string[] EventsWanted = {
			       "OnHandleCreated",
				 "OnBindingContextChanged",
				 "OnBindingContextChanged",
				 "OnForeColorChanged",
				 "OnInvalidated"
		       };
		       Form myform = new Form ();
		       myform.ShowInTaskbar = false;
		       myform.Visible = true;
		       MyScrollBar s = new MyScrollBar ();
		       myform.Controls.Add (s);
		       s.ForeColor = Color.Aqua;

		       Assert.AreEqual (EventsWanted, ArrayListToString (s.Results));
		       myform.Dispose ();
	       }
Пример #4
0
	    public void TextChangedTest ()
	       {
		       Form myform = new Form ();
		       myform.ShowInTaskbar = false;
		       myform.Visible = true;
		       MyScrollBar myHscrlbar = new MyScrollBar ();
		       myform.Controls.Add (myHscrlbar);
		       myHscrlbar.TextChanged += new EventHandler (ScrollBar_EventHandler);
		       myHscrlbar.Text = "foo";

		       Assert.AreEqual (true, eventhandled, "T6");
		       eventhandled = false;
		       myform.Dispose ();
	       }
Пример #5
0
	    public void ValueChangeTest ()
	       {
		       Form myform = new Form ();
		       myform.ShowInTaskbar = false;
		       myform.Visible = true;
		       MyScrollBar myHscrlbar = new MyScrollBar ();
		       myform.Controls.Add (myHscrlbar);
		       myHscrlbar.Value = 40 ;
		       myHscrlbar.ValueChanged += new EventHandler (ScrollBar_EventHandler);
		       myHscrlbar.Value = 50 ;
		       Assert.AreEqual (true, eventhandled, "V3");
		       eventhandled = false;
		       myform.Dispose ();
	       }
Пример #6
0
	   public void DefaultMarginTest ()
	   {
		   MyScrollBar s = new MyScrollBar ();
		   Assert.AreEqual (new Padding (0), s.PublicDefaultMargin, "A1");
	   }
Пример #7
0
	    public void ScrollTest ()
	       {
		       Form myform = new Form ();
		       myform.ShowInTaskbar = false;
		       myform.Visible = true;
		       MyScrollBar myHscrlbar = new MyScrollBar ();
		       myform.Controls.Add (myHscrlbar);
		       myHscrlbar.Scroll += new ScrollEventHandler (ScrollBarScroll_EventHandler);
		       myHscrlbar.ScrollNow ();

		       Assert.AreEqual (true, eventhandled, "S4");
		       eventhandled = false;
		       myform.Dispose ();
	       }
Пример #8
0
	    public void PubMethodTest ()
	       {
		       MyScrollBar myscrlbar = new MyScrollBar ();
		       myscrlbar.Text = "New HScrollBar";
		       Assert.AreEqual ("MonoTests.System.Windows.Forms.MyScrollBar, Minimum: 0, Maximum: 100, Value: 0",
					myscrlbar.ToString (), "T5");
	       }
Пример #9
0
	   public void ExceptionLargeChangeTest ()
	       {
		       MyScrollBar myscrlbar = new MyScrollBar ();
		       myscrlbar.LargeChange = -1;
	       }
Пример #10
0
	   public void ExceptionSmallChangeTest ()
	       {
		       MyScrollBar myscrlbar = new MyScrollBar ();
		       myscrlbar.SmallChange = -1;
	       }
Пример #11
0
	   public void ExceptionValueTest ()
	       {
		       MyScrollBar myscrlbar = new MyScrollBar ();
		       myscrlbar.Minimum = 10;
		       myscrlbar.Maximum = 20;
		       myscrlbar.Value = 9;
		       myscrlbar.Value = 21;
	       }
Пример #12
0
	    public void PubPropTest ()
	       {
		       MyScrollBar myscrlbar = new MyScrollBar ();

		       // B
		       myscrlbar.BackColor = Color.Red;
		       Assert.AreEqual (255, myscrlbar.BackColor.R, "B2");
		       myscrlbar.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");
		       Assert.AreEqual (16, myscrlbar.BackgroundImage.Height, "B3");

		       // F
		       Assert.AreEqual ("ControlText", myscrlbar.ForeColor.Name, "F1");

		       // I
		       //Assert.AreEqual (ImeMode.Disable, myscrlbar.ImeMode, "I1");

		       // L
		       Assert.AreEqual (10, myscrlbar.LargeChange, "L1");

		       // M
		       Assert.AreEqual (100, myscrlbar.Maximum, "M1");
		       Assert.AreEqual (0, myscrlbar.Minimum, "M2");
		       myscrlbar.Maximum = 300;
		       myscrlbar.Minimum = 100;
		       Assert.AreEqual (300, myscrlbar.Maximum, "M3");
		       Assert.AreEqual (100, myscrlbar.Minimum, "M4");

		       // S
		       Assert.AreEqual (null, myscrlbar.Site, "S1");
		       Assert.AreEqual (1, myscrlbar.SmallChange, "S2");
		       myscrlbar.SmallChange = 10;
		       Assert.AreEqual (10, myscrlbar.SmallChange, "S3");

		       // T
		       Assert.AreEqual (false, myscrlbar.TabStop, "T1");
		       myscrlbar.TabStop = true;
		       Assert.AreEqual (true, myscrlbar.TabStop, "T2");
		       Assert.AreEqual ("", myscrlbar.Text, "T3");
		       myscrlbar.Text = "MONO SCROLLBAR";
		       Assert.AreEqual ("MONO SCROLLBAR", myscrlbar.Text, "T4");

		       // V
		       Assert.AreEqual (100, myscrlbar.Value, "V1");
		       myscrlbar.Value = 150;
		       Assert.AreEqual (150, myscrlbar.Value, "V2");
	       }