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 (); }
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 (); }
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 (); }
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 (); }
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 (); }
public void DefaultMarginTest () { MyScrollBar s = new MyScrollBar (); Assert.AreEqual (new Padding (0), s.PublicDefaultMargin, "A1"); }
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 (); }
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"); }
public void ExceptionLargeChangeTest () { MyScrollBar myscrlbar = new MyScrollBar (); myscrlbar.LargeChange = -1; }
public void ExceptionSmallChangeTest () { MyScrollBar myscrlbar = new MyScrollBar (); myscrlbar.SmallChange = -1; }
public void ExceptionValueTest () { MyScrollBar myscrlbar = new MyScrollBar (); myscrlbar.Minimum = 10; myscrlbar.Maximum = 20; myscrlbar.Value = 9; myscrlbar.Value = 21; }
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"); }