You've already forked linux-packaging-mono
Imported Upstream version 5.20.0.180
Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
parent
0e2d47d1c8
commit
0510252385
@@ -11,6 +11,8 @@ using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -220,7 +222,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
Button B1 = new Button ();
|
||||
B1.Visible = true;
|
||||
B1.Image = Image.FromFile ("M.gif");
|
||||
B1.Image = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
Assert.AreEqual (ContentAlignment.MiddleCenter, B1.ImageAlign, "#2");
|
||||
}
|
||||
|
||||
@@ -228,13 +230,13 @@ namespace MonoTests.System.Windows.Forms
|
||||
public void ImageListTest ()
|
||||
{
|
||||
Button B1 = new Button ();
|
||||
B1.Image = Image.FromFile ("M.gif");
|
||||
B1.Image = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
Assert.AreEqual (null, B1.ImageList, "#3a");
|
||||
|
||||
B1 = new Button ();
|
||||
ImageList ImageList1 = new ImageList ();
|
||||
ImageList1.Images.Add(Image.FromFile ("M.gif"));
|
||||
ImageList1.Images.Add(Image.FromFile ("M.gif"));
|
||||
ImageList1.Images.Add(Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif")));
|
||||
ImageList1.Images.Add(Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif")));
|
||||
Assert.AreEqual (2, ImageList1.Images.Count, "#3b");
|
||||
B1.ImageList = ImageList1;
|
||||
Assert.AreEqual (-1, B1.ImageIndex, "#3c");
|
||||
|
||||
@@ -5,6 +5,8 @@ using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -33,7 +35,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Control c = new Control ();
|
||||
// Test BackgroundImageChanged Event
|
||||
c.BackgroundImageChanged += new EventHandler (Event_Handler1);
|
||||
string abc = "M.gif";
|
||||
string abc = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
eventhandled = false;
|
||||
c.BackgroundImage = Image.FromFile (abc);
|
||||
Assert.AreEqual (true, eventhandled, "#A2");
|
||||
|
||||
@@ -10,6 +10,8 @@ using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -23,7 +25,8 @@ namespace MonoTests.System.Windows.Forms
|
||||
// this contains an and mask, it used to crash
|
||||
//
|
||||
|
||||
new Cursor (typeof (CursorTest).Assembly.GetManifestResourceStream ("a.cur"));
|
||||
var c = new Cursor (TestResourceHelper.GetStreamOfResource ("Test/resources/a.cur"));
|
||||
Assert.NotNull (c);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -16,6 +16,8 @@ using System.Windows.Forms;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -28,8 +30,8 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assembly a = typeof (ImageListStreamerTest).Assembly;
|
||||
|
||||
ImageList imgList = new ImageList ();
|
||||
imgList.Images.Add (Image.FromStream (a.GetManifestResourceStream ("32x32.ico")));
|
||||
imgList.Images.Add (Image.FromFile ("M.gif"));
|
||||
imgList.Images.Add (Image.FromStream (TestResourceHelper.GetStreamOfResource ("Test/resources/32x32.ico")));
|
||||
imgList.Images.Add (Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif")));
|
||||
|
||||
MemoryStream ms = new MemoryStream ();
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ using System.Windows.Forms;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -40,7 +42,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual ("System.IntPtr", myimagelist.Handle.GetType ().FullName, "#H3");
|
||||
|
||||
// I
|
||||
Image myImage = Image.FromFile("M.gif");
|
||||
Image myImage = Image.FromFile(TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
myimagelist.Images.Add (myImage);
|
||||
Assert.AreEqual (1, myimagelist.Images.Count, "#I1");
|
||||
Assert.AreEqual (16, myimagelist.ImageSize.Height, "#I2");
|
||||
@@ -86,7 +88,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
// create an ImageList containing an image
|
||||
il = new ImageList ();
|
||||
il.Images.Add (Image.FromFile ("M.gif"));
|
||||
il.Images.Add (Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif")));
|
||||
|
||||
Assert.IsFalse (colordepth_prop.ShouldSerializeValue (il), "13");
|
||||
Assert.IsFalse (colordepth_prop.CanResetValue (il), "14");
|
||||
@@ -125,7 +127,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
ImageList imgList = new ImageList ();
|
||||
ImageList.ImageCollection coll = imgList.Images;
|
||||
|
||||
Image gif = Image.FromFile ("M.gif");
|
||||
Image gif = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
coll.Add (gif);
|
||||
Bitmap bmp = new Bitmap (10, 10);
|
||||
coll.Add (bmp);
|
||||
@@ -170,7 +172,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
myform.ShowInTaskbar = false;
|
||||
Graphics mygraphics = null;
|
||||
ImageList myimagelist = new ImageList ();
|
||||
Image myImage = Image.FromFile("M.gif");
|
||||
Image myImage = Image.FromFile(TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
myimagelist.Images.Add (myImage);
|
||||
myimagelist.ColorDepth = ColorDepth.Depth8Bit;
|
||||
myimagelist.ImageSize = new Size (50,50);
|
||||
|
||||
@@ -12,6 +12,8 @@ using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -403,7 +405,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
l.Visible = true;
|
||||
myform.Controls.Add (l);
|
||||
l.BackgroundImageChanged += new EventHandler (Label_EventHandler);
|
||||
l.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");
|
||||
l.BackgroundImage = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/System.Windows.Forms/bitmaps/a.png"));
|
||||
Assert.AreEqual (true, eventhandled, "B4");
|
||||
eventhandled = false;
|
||||
myform.Dispose();
|
||||
@@ -770,7 +772,7 @@ public class MyLabel : Label
|
||||
myform.Visible = true;
|
||||
MyLabel l = new MyLabel ();
|
||||
myform.Controls.Add (l);
|
||||
l.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");
|
||||
l.BackgroundImage = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/System.Windows.Forms/bitmaps/a.png"));
|
||||
|
||||
Assert.AreEqual (EventsWanted, ArrayListToString (l.Results));
|
||||
myform.Dispose();
|
||||
@@ -1152,7 +1154,7 @@ public class MyLabel2 : Label
|
||||
myform.Visible = true;
|
||||
MyLabel2 l = new MyLabel2 ();
|
||||
myform.Controls.Add (l);
|
||||
l.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");
|
||||
l.BackgroundImage = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/System.Windows.Forms/bitmaps/a.png"));
|
||||
|
||||
Assert.AreEqual (EventsWanted, ArrayListToString (l.Results));
|
||||
myform.Dispose();
|
||||
|
||||
@@ -16,6 +16,8 @@ using System.Windows.Forms;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -53,18 +55,18 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
Assert.IsNull (pb.ImageLocation, "#A");
|
||||
|
||||
pb.ImageLocation = "M.gif";
|
||||
pb.ImageLocation = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
Application.DoEvents ();
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#B1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#B1");
|
||||
Assert.AreSame (pb.InitialImage, pb.Image, "#B2");
|
||||
|
||||
using (Stream s = this.GetType ().Assembly.GetManifestResourceStream ("32x32.ico")) {
|
||||
using (Stream s = TestResourceHelper.GetStreamOfResource ("Test/resources/32x32.ico")) {
|
||||
pb.Image = Image.FromStream (s);
|
||||
}
|
||||
Application.DoEvents ();
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#C1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#C1");
|
||||
Assert.IsNotNull (pb.Image, "#C2");
|
||||
Assert.AreEqual (60, pb.Image.Height, "#C3");
|
||||
Assert.AreEqual (150, pb.Image.Width, "#C4");
|
||||
@@ -75,16 +77,16 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsNull (pb.ImageLocation, "#D1");
|
||||
Assert.IsNull (pb.Image, "#D2");
|
||||
|
||||
pb.ImageLocation = "M.gif";
|
||||
pb.ImageLocation = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
Application.DoEvents ();
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#E1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#E1");
|
||||
Assert.IsNull (pb.Image, "#E2");
|
||||
|
||||
pb.Load ();
|
||||
Application.DoEvents ();
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#F1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#F1");
|
||||
Assert.IsNotNull (pb.Image, "#F2");
|
||||
Assert.AreEqual (60, pb.Image.Height, "#F3");
|
||||
Assert.AreEqual (150, pb.Image.Width, "#F4");
|
||||
@@ -95,7 +97,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsNull (pb.ImageLocation, "#G1");
|
||||
Assert.IsNull (pb.Image, "#G2");
|
||||
|
||||
pb.ImageLocation = "M.gif";
|
||||
pb.ImageLocation = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
pb.Load ();
|
||||
pb.ImageLocation = "XYZ.gif";
|
||||
Application.DoEvents ();
|
||||
@@ -111,7 +113,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (string.Empty, pb.ImageLocation, "#I1");
|
||||
Assert.IsNull (pb.Image, "#I2");
|
||||
|
||||
using (Stream s = this.GetType ().Assembly.GetManifestResourceStream ("32x32.ico")) {
|
||||
using (Stream s = TestResourceHelper.GetStreamOfResource ("Test/resources/32x32.ico")) {
|
||||
pb.Image = Image.FromStream (s);
|
||||
}
|
||||
Application.DoEvents ();
|
||||
@@ -121,10 +123,10 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (96, pb.Image.Height, "#J3");
|
||||
Assert.AreEqual (96, pb.Image.Width, "#J4");
|
||||
|
||||
pb.Load ("M.gif");
|
||||
pb.Load (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
Application.DoEvents ();
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#K1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#K1");
|
||||
Assert.IsNotNull (pb.Image, "#K2");
|
||||
Assert.AreEqual (60, pb.Image.Height, "#K3");
|
||||
Assert.AreEqual (150, pb.Image.Width, "#K4");
|
||||
@@ -149,18 +151,18 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
Assert.IsNull (pb.ImageLocation, "#A");
|
||||
|
||||
pb.ImageLocation = "M.gif";
|
||||
pb.ImageLocation = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#B1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#B1");
|
||||
Assert.IsNotNull (pb.Image, "#B2");
|
||||
Assert.AreEqual (60, pb.Image.Height, "#B3");
|
||||
Assert.AreEqual (150, pb.Image.Width, "#B4");
|
||||
|
||||
using (Stream s = this.GetType ().Assembly.GetManifestResourceStream ("32x32.ico")) {
|
||||
using (Stream s = TestResourceHelper.GetStreamOfResource ("Test/resources/32x32.ico")) {
|
||||
pb.Image = Image.FromStream (s);
|
||||
}
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#C1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#C1");
|
||||
Assert.IsNotNull (pb.Image, "#C2");
|
||||
Assert.AreEqual (96, pb.Image.Height, "#C3");
|
||||
Assert.AreEqual (96, pb.Image.Width, "#C4");
|
||||
@@ -172,16 +174,16 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (96, pb.Image.Height, "#D3");
|
||||
Assert.AreEqual (96, pb.Image.Width, "#D4");
|
||||
|
||||
pb.ImageLocation = "M.gif";
|
||||
pb.ImageLocation = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#E1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#E1");
|
||||
Assert.IsNotNull (pb.Image, "#E2");
|
||||
Assert.AreEqual (60, pb.Image.Height, "#E3");
|
||||
Assert.AreEqual (150, pb.Image.Width, "#E4");
|
||||
|
||||
pb.Load ();
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#F1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#F1");
|
||||
Assert.IsNotNull (pb.Image, "#F2");
|
||||
Assert.AreEqual (60, pb.Image.Height, "#F3");
|
||||
Assert.AreEqual (150, pb.Image.Width, "#F4");
|
||||
@@ -191,7 +193,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsNull (pb.ImageLocation, "#G1");
|
||||
Assert.IsNull (pb.Image, "#G2");
|
||||
|
||||
using (Stream s = this.GetType ().Assembly.GetManifestResourceStream ("32x32.ico")) {
|
||||
using (Stream s = TestResourceHelper.GetStreamOfResource ("Test/resources/32x32.ico")) {
|
||||
pb.Image = Image.FromStream (s);
|
||||
}
|
||||
|
||||
@@ -200,9 +202,9 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (96, pb.Image.Height, "#H3");
|
||||
Assert.AreEqual (96, pb.Image.Width, "#H4");
|
||||
|
||||
pb.Load ("M.gif");
|
||||
pb.Load (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#I1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#I1");
|
||||
Assert.IsNotNull (pb.Image, "#I2");
|
||||
Assert.AreEqual (60, pb.Image.Height, "#I3");
|
||||
Assert.AreEqual (150, pb.Image.Width, "#I4");
|
||||
@@ -212,9 +214,9 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (string.Empty, pb.ImageLocation, "#J1");
|
||||
Assert.IsNull (pb.Image, "#J2");
|
||||
|
||||
pb.ImageLocation = "M.gif";
|
||||
pb.ImageLocation = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
|
||||
Assert.AreEqual ("M.gif", pb.ImageLocation, "#K1");
|
||||
Assert.AreEqual (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"), pb.ImageLocation, "#K1");
|
||||
Assert.IsNotNull (pb.Image, "#K2");
|
||||
Assert.AreEqual (60, pb.Image.Height, "#K3");
|
||||
Assert.AreEqual (150, pb.Image.Width, "#K4");
|
||||
@@ -242,7 +244,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
PictureBox myPicBox = new PictureBox ();
|
||||
// I
|
||||
Assert.IsNull (myPicBox.Image, "#1");
|
||||
Image myImage = Image.FromFile ("M.gif");
|
||||
Image myImage = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
myPicBox.Image = myImage;
|
||||
Assert.AreSame (myImage, myPicBox.Image, "#2");
|
||||
Assert.AreEqual (60, myPicBox.Image.Height, "#3");
|
||||
|
||||
@@ -13,6 +13,8 @@ using System.Drawing;
|
||||
using System.Reflection;
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -29,7 +31,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
// B
|
||||
Assert.AreEqual ("Control", myProgressBar.BackColor.Name, "#B1");
|
||||
Assert.AreEqual (null, myProgressBar.BackgroundImage, "#B3");
|
||||
string gif = "M.gif";
|
||||
string gif = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
myProgressBar.BackgroundImage = Image.FromFile (gif);
|
||||
// comparing image objects fails on MS .Net so using Size property
|
||||
Assert.AreEqual (Image.FromFile(gif, true).Size, myProgressBar.BackgroundImage.Size, "#B4");
|
||||
|
||||
@@ -15,6 +15,8 @@ using System.Windows.Forms;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -37,7 +39,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
// B
|
||||
rTBox.BackColor = Color.White;
|
||||
Assert.AreEqual (null, rTBox.BackgroundImage, "#B1");
|
||||
string gif = "M.gif";
|
||||
string gif = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
rTBox.BackgroundImage = Image.FromFile (gif);
|
||||
// comparing image objects fails on MS .Net so using Size property
|
||||
Assert.AreEqual (Image.FromFile(gif, true).Size, rTBox.BackgroundImage.Size, "#B2");
|
||||
@@ -103,7 +105,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public void CanPasteTest ()
|
||||
{
|
||||
RichTextBox rTextBox = new RichTextBox ();
|
||||
Bitmap myBitmap = new Bitmap ("M.gif");
|
||||
Bitmap myBitmap = new Bitmap (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
Clipboard.SetDataObject (myBitmap);
|
||||
DataFormats.Format myFormat = DataFormats.GetFormat (DataFormats.Bitmap);
|
||||
Assert.AreEqual (true, rTextBox.CanPaste (myFormat), "#Mtd1");
|
||||
|
||||
@@ -13,6 +13,8 @@ using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
|
||||
@@ -286,7 +288,7 @@ public class MyScrollBar : HScrollBar
|
||||
// B
|
||||
myscrlbar.BackColor = Color.Red;
|
||||
Assert.AreEqual (255, myscrlbar.BackColor.R, "B2");
|
||||
myscrlbar.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");
|
||||
myscrlbar.BackgroundImage = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/System.Windows.Forms/bitmaps/a.png"));
|
||||
Assert.AreEqual (16, myscrlbar.BackgroundImage.Height, "B3");
|
||||
|
||||
// F
|
||||
@@ -551,7 +553,7 @@ public class MyScrollBar : HScrollBar
|
||||
ScrollBar myHscrlbar = new HScrollBar ();
|
||||
myform.Controls.Add (myHscrlbar);
|
||||
myHscrlbar.BackgroundImageChanged += new EventHandler (ScrollBar_EventHandler);
|
||||
myHscrlbar.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");
|
||||
myHscrlbar.BackgroundImage = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/System.Windows.Forms/bitmaps/a.png"));
|
||||
Assert.AreEqual (true, eventhandled, "B5");
|
||||
eventhandled = false;
|
||||
myform.Dispose ();
|
||||
@@ -820,7 +822,7 @@ public class MyVScrollBar : VScrollBar
|
||||
myform.Visible = true;
|
||||
MyScrollBar s = new MyScrollBar ();
|
||||
myform.Controls.Add (s);
|
||||
s.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");
|
||||
s.BackgroundImage = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/System.Windows.Forms/bitmaps/a.png"));
|
||||
|
||||
Assert.AreEqual (EventsWanted, ArrayListToString (s.Results));
|
||||
myform.Dispose ();
|
||||
@@ -1376,7 +1378,7 @@ public class MyScrollBar2 : HScrollBar
|
||||
myform.Visible = true;
|
||||
MyScrollBar2 s = new MyScrollBar2 ();
|
||||
myform.Controls.Add (s);
|
||||
s.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");
|
||||
s.BackgroundImage = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/System.Windows.Forms/bitmaps/a.png"));
|
||||
|
||||
Assert.AreEqual (EventsWanted, ArrayListToString (s.Results));
|
||||
myform.Dispose ();
|
||||
|
||||
@@ -15,6 +15,8 @@ using System.Text;
|
||||
using NUnit.Framework;
|
||||
using CategoryAttribute = NUnit.Framework.CategoryAttribute;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -45,7 +47,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (true, textBox.AcceptsTab, "#1b");
|
||||
Assert.AreEqual (true, textBox.AutoSize, "#2");
|
||||
Assert.AreEqual (null, textBox.BackgroundImage, "#4a");
|
||||
string gif = "M.gif";
|
||||
string gif = TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif");
|
||||
textBox.BackgroundImage = Image.FromFile (gif);
|
||||
// comparing image objects fails on MS .Net so using Size property
|
||||
Assert.AreEqual (Image.FromFile(gif, true).Size, textBox.BackgroundImage.Size, "#4b");
|
||||
|
||||
@@ -14,6 +14,8 @@ using System.Windows.Forms;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -46,7 +48,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
// B
|
||||
Assert.AreEqual ("Control", myToolBar.BackColor.Name, "#B1");
|
||||
myToolBar.BackgroundImage = Image.FromFile ("M.gif");
|
||||
myToolBar.BackgroundImage = Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif"));
|
||||
Assert.AreEqual (60, myToolBar.BackgroundImage.Height, "#B3");
|
||||
Assert.AreEqual (BorderStyle.None, myToolBar.BorderStyle, "#B4");
|
||||
myToolBar.BorderStyle = BorderStyle.Fixed3D;
|
||||
@@ -64,7 +66,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
// I
|
||||
ImageList myImageList = new ImageList ();
|
||||
myImageList.Images.Add (Image.FromFile ("M.gif"));
|
||||
myImageList.Images.Add (Image.FromFile (TestResourceHelper.GetFullPathOfResource ("Test/resources/M.gif")));
|
||||
myToolBar.ImageList = myImageList;
|
||||
Assert.AreEqual (1, myToolBar.ImageList.Images.Count, "#I1");
|
||||
Assert.AreEqual (16, myToolBar.ImageSize.Height, "#I2");
|
||||
|
||||
Reference in New Issue
Block a user