You've already forked linux-packaging-mono
Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
parent
1190d13a04
commit
6bdd276d05
@@ -47,7 +47,7 @@ namespace MonoTests.System.Resources {
|
||||
|
||||
Assert.IsNotNull (returnedNode, "#A1");
|
||||
object val = returnedNode.GetValue (new ReturnSerializableSubClassITRS ());
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A2");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A2");
|
||||
Assert.IsInstanceOfType (typeof (serializable), val, "#A3");
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace MonoTests.System.Resources {
|
||||
node = GetNodeFileRefToSerializable ("ser.bbb",true);
|
||||
|
||||
object val = node.GetValue (new ReturnSerializableSubClassITRS ());
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A1");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A1");
|
||||
Assert.IsInstanceOfType (typeof (serializable), val, "#A2");
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace MonoTests.System.Resources {
|
||||
// get value passing no params
|
||||
object val = returnedNode.GetValue ((ITypeResolutionService) null);
|
||||
Assert.IsInstanceOfType (typeof (serializable), val, "#A2");
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A3");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A3");
|
||||
|
||||
//get value type passing different params
|
||||
string newType = returnedNode.GetValueTypeName (new ReturnSerializableSubClassITRS ());
|
||||
|
||||
@@ -50,10 +50,10 @@ namespace MonoTests.System.Resources {
|
||||
|
||||
object defaultVal = returnedNode.GetValue ((ITypeResolutionService) null);
|
||||
Assert.IsInstanceOfType (typeof (serializable), defaultVal, "#A2");
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), defaultVal, "#A3");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), defaultVal, "#A3");
|
||||
|
||||
object newVal = returnedNode.GetValue (new ReturnSerializableSubClassITRS ());
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), newVal, "#A4");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), newVal, "#A4");
|
||||
Assert.IsInstanceOfType (typeof (serializable), newVal, "#A5");
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace MonoTests.System.Resources {
|
||||
|
||||
// get value passing null params
|
||||
object val = returnedNode.GetValue ((ITypeResolutionService) null);
|
||||
// Assert.IsNotInstanceOfType (typeof (serializable), val, "#A5"); this would fail as subclasses are id-ed as instances of parents
|
||||
// AssertHelper.IsNotInstanceOfType (typeof (serializable), val, "#A5"); this would fail as subclasses are id-ed as instances of parents
|
||||
Assert.IsInstanceOfType (typeof (serializableSubClass), val, "#A4");
|
||||
}
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@ namespace MonoTests.System.Resources {
|
||||
|
||||
object o = node.GetValue ((AssemblyName []) null);
|
||||
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), o, "#A2");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), o, "#A2");
|
||||
Assert.IsInstanceOfType (typeof (serializable), o, "#A3");
|
||||
rr.Close ();
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace MonoTests.System.Resources {
|
||||
Assert.IsNotNull (finalNode, "#A3");
|
||||
|
||||
object finalVal = finalNode.GetValue ((ITypeResolutionService) null);
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), finalVal, "#A4");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), finalVal, "#A4");
|
||||
Assert.IsInstanceOfType (typeof (serializable), finalVal, "#A5");
|
||||
}
|
||||
|
||||
|
||||
@@ -229,6 +229,26 @@ namespace MonoTests.System.Resources
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConvertFrom_Type_String_FilePathWithBackslashes ()
|
||||
{
|
||||
if (Path.DirectorySeparatorChar == '\\')
|
||||
// non-windows test
|
||||
return;
|
||||
|
||||
string fileContents = "foobar";
|
||||
string fileName = "foo.txt";
|
||||
string filePath = Path.Combine (_tempDirectory, fileName);
|
||||
File.WriteAllText (filePath, fileContents);
|
||||
|
||||
filePath = _tempDirectory + "\\.\\" + fileName;
|
||||
|
||||
string fileRef = filePath + ";" + typeof (string).AssemblyQualifiedName;
|
||||
string result = _converter.ConvertFrom (fileRef) as string;
|
||||
Assert.IsNotNull (result, "#A1");
|
||||
Assert.AreEqual (result, fileContents, "#A2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConvertFrom_Type_StreamReader ()
|
||||
{
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore ("causes an infinite restart loop since we're not in a separate AppDomain with nunit-lite")]
|
||||
[ExpectedException (typeof (NotSupportedException))]
|
||||
public void RestartNotSupportedExceptionTest ()
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.Anchor;
|
||||
c.Anchor = AnchorStyles.Right;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.AutoScrollOffset;
|
||||
c.AutoScrollOffset = new Point (40, 40);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A7");
|
||||
@@ -174,7 +174,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A42");
|
||||
o = c.IsDisposed;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A43");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.IsMirrored;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A44");
|
||||
#endif
|
||||
@@ -245,7 +245,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A66");
|
||||
o = c.TopLevelControl;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A67");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.UseWaitCursor;
|
||||
c.UseWaitCursor = true;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A68");
|
||||
@@ -270,7 +270,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
ProtectedPropertyControl c = new ProtectedPropertyControl ();
|
||||
|
||||
object o;
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.PublicCanRaiseEvents;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A1");
|
||||
#endif
|
||||
@@ -301,7 +301,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.PublicResizeRedraw;
|
||||
c.PublicResizeRedraw = !c.PublicResizeRedraw;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A13");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.PublicScaleChildren;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A14");
|
||||
#endif
|
||||
@@ -448,7 +448,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
private class ProtectedPropertyControl : Control
|
||||
{
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicCanRaiseEvents { get { return base.CanRaiseEvents; } }
|
||||
#endif
|
||||
public CreateParams PublicCreateParams { get { return base.CreateParams; } }
|
||||
@@ -463,7 +463,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public int PublicFontHeight { get { return base.FontHeight; } set { base.FontHeight = value; } }
|
||||
public bool PublicRenderRightToLeft { get { return base.RenderRightToLeft; } }
|
||||
public bool PublicResizeRedraw { get { return base.ResizeRedraw; } set { base.ResizeRedraw = value; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicScaleChildren { get { return base.ScaleChildren; } }
|
||||
#endif
|
||||
public bool PublicShowFocusCues { get { return base.ShowFocusCues; } }
|
||||
@@ -495,7 +495,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c = new ProtectedMethodsControl ();
|
||||
c.PublicGetAccessibilityObjectById (0);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicGetAutoSizeMode ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "A7");
|
||||
c.PublicGetScaledBounds (new Rectangle (0, 0, 100, 100), new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
@@ -549,7 +549,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A29");
|
||||
c.PublicRtlTranslateLeftRight (LeftRightAlignment.Left);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A30");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicScaleControl (new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A31");
|
||||
#endif
|
||||
@@ -557,7 +557,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A32");
|
||||
c.PublicSelect ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "A33");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicSetAutoSizeMode (AutoSizeMode.GrowAndShrink);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A34");
|
||||
#endif
|
||||
@@ -594,7 +594,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public void PublicCreateHandle () { base.CreateHandle (); }
|
||||
public void PublicDestroyHandle () { base.DestroyHandle (); }
|
||||
public AccessibleObject PublicGetAccessibilityObjectById (int objectId) { return base.GetAccessibilityObjectById (objectId); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public AutoSizeMode PublicGetAutoSizeMode () { return base.GetAutoSizeMode (); }
|
||||
public Rectangle PublicGetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified) { return base.GetScaledBounds (bounds, factor, specified); }
|
||||
#endif
|
||||
@@ -620,12 +620,12 @@ namespace MonoTests.System.Windows.Forms
|
||||
public ContentAlignment PublicRtlTranslateContent (ContentAlignment align) { return base.RtlTranslateContent (align); }
|
||||
public HorizontalAlignment PublicRtlTranslateHorizontal (HorizontalAlignment align) { return base.RtlTranslateHorizontal (align); }
|
||||
public LeftRightAlignment PublicRtlTranslateLeftRight (LeftRightAlignment align) { return base.RtlTranslateLeftRight (align); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScaleControl (SizeF factor, BoundsSpecified specified) { base.ScaleControl (factor, specified); }
|
||||
#endif
|
||||
public void PublicScaleCore (float dx, float dy) { base.ScaleCore (dx, dy); }
|
||||
public void PublicSelect () { base.Select (); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicSetAutoSizeMode (AutoSizeMode mode) { base.SetAutoSizeMode (mode); }
|
||||
#endif
|
||||
public void PublicSetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { base.SetBoundsCore (x, y, width, height, specified); }
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.Anchor;
|
||||
c.Anchor = AnchorStyles.Right;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.AutoScrollOffset;
|
||||
c.AutoScrollOffset = new Point (40, 40);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A7");
|
||||
@@ -133,7 +133,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.AutoScrollMinSize = new Size (c.AutoScrollMinSize.Width + 1, c.AutoScrollMinSize.Height + 1);
|
||||
Assert.IsFalse (c.IsHandleCreated, "FA9");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.AutoScrollOffset;
|
||||
c.AutoScrollOffset = new Point (c.AutoScrollOffset.X + 1, c.AutoScrollOffset.Y + 1);
|
||||
Assert.IsFalse (c.IsHandleCreated, "FA10");
|
||||
@@ -146,7 +146,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.AutoSize;
|
||||
c.AutoSize = !c.AutoSize;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FA12");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.AutoSizeMode;
|
||||
c.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FA13");
|
||||
@@ -311,7 +311,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.HelpButton = !c.HelpButton;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FH1");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.HorizontalScroll;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FH2");
|
||||
#endif
|
||||
@@ -324,7 +324,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A42");
|
||||
o = c.IsDisposed;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A43");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.IsMirrored;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A44");
|
||||
#endif
|
||||
@@ -457,7 +457,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.ParentForm;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FP1");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.RestoreBounds;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FR1");
|
||||
#endif
|
||||
@@ -483,7 +483,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A66");
|
||||
o = c.TopLevelControl;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A67");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.UseWaitCursor;
|
||||
c.UseWaitCursor = true;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A68");
|
||||
@@ -544,7 +544,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.TransparencyKey = Color.BurlyWood;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FT4");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.VerticalScroll;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FV1");
|
||||
#endif
|
||||
@@ -565,7 +565,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
ProtectedPropertyForm c = new ProtectedPropertyForm ();
|
||||
|
||||
object o;
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.PublicCanRaiseEvents;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A1");
|
||||
#endif
|
||||
@@ -596,7 +596,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.PublicResizeRedraw;
|
||||
c.PublicResizeRedraw = !c.PublicResizeRedraw;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A13");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.PublicScaleChildren;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A14");
|
||||
#endif
|
||||
@@ -789,7 +789,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.LayoutMdi (MdiLayout.Cascade);
|
||||
Assert.IsFalse (c.IsHandleCreated, "F5");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PerformAutoScale ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "F6");
|
||||
#endif
|
||||
@@ -827,7 +827,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.Validate ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "F15");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.ValidateChildren ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "F16");
|
||||
#endif
|
||||
@@ -865,7 +865,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public class ProtectedPropertyForm : Form
|
||||
{
|
||||
public SizeF PublicAutoScaleFactor { get { return base.AutoScaleFactor; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicCanRaiseEvents { get { return base.CanRaiseEvents; } }
|
||||
#endif
|
||||
public CreateParams PublicCreateParams { get { return base.CreateParams; } }
|
||||
@@ -884,7 +884,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public Rectangle PublicMaximizedBounds { get {return base.MaximizedBounds; } set { base.MaximizedBounds = value; }}
|
||||
public bool PublicRenderRightToLeft { get { return base.RenderRightToLeft; } }
|
||||
public bool PublicResizeRedraw { get { return base.ResizeRedraw; } set { base.ResizeRedraw = value; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicScaleChildren { get { return base.ScaleChildren; } }
|
||||
#endif
|
||||
public bool PublicShowFocusCues { get { return base.ShowFocusCues; } }
|
||||
@@ -925,7 +925,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c = new ProtectedMethodsForm ();
|
||||
c.PublicGetAccessibilityObjectById (0);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicGetAutoSizeMode ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "A7");
|
||||
c.PublicGetScaledBounds (new Rectangle (0, 0, 100, 100), new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
@@ -983,7 +983,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A29");
|
||||
c.PublicRtlTranslateLeftRight (LeftRightAlignment.Left);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A30");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicScaleControl (new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A31");
|
||||
#endif
|
||||
@@ -994,7 +994,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.Dispose ();
|
||||
|
||||
c = new ProtectedMethodsForm ();
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicSetAutoSizeMode (AutoSizeMode.GrowAndShrink);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A34");
|
||||
#endif
|
||||
@@ -1081,7 +1081,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.PublicProcessTabKey (true);
|
||||
Assert.IsFalse (c.IsHandleCreated, "F14");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.Controls.Add (new Control ());
|
||||
c.PublicScrollToControl (c.Controls [0]);
|
||||
Assert.IsFalse (c.IsHandleCreated, "F15");
|
||||
@@ -1119,7 +1119,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public void PublicCreateHandle () { base.CreateHandle (); }
|
||||
public void PublicDestroyHandle () { base.DestroyHandle (); }
|
||||
public AccessibleObject PublicGetAccessibilityObjectById (int objectId) { return base.GetAccessibilityObjectById (objectId); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public AutoSizeMode PublicGetAutoSizeMode () { return base.GetAutoSizeMode (); }
|
||||
public Rectangle PublicGetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified) { return base.GetScaledBounds (bounds, factor, specified); }
|
||||
#endif
|
||||
@@ -1155,17 +1155,17 @@ namespace MonoTests.System.Windows.Forms
|
||||
public ContentAlignment PublicRtlTranslateContent (ContentAlignment align) { return base.RtlTranslateContent (align); }
|
||||
public HorizontalAlignment PublicRtlTranslateHorizontal (HorizontalAlignment align) { return base.RtlTranslateHorizontal (align); }
|
||||
public LeftRightAlignment PublicRtlTranslateLeftRight (LeftRightAlignment align) { return base.RtlTranslateLeftRight (align); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScaleControl (SizeF factor, BoundsSpecified specified) { base.ScaleControl (factor, specified); }
|
||||
#endif
|
||||
public void PublicScaleCore (float dx, float dy) { base.ScaleCore (dx, dy); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScrollToControl (Control activeControl) { base.ScrollToControl (activeControl); }
|
||||
#endif
|
||||
public void PublicSelect () { base.Select (); }
|
||||
public void PublicSelect (bool directed, bool forward) { base.Select (directed, forward); }
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicSetAutoSizeMode (AutoSizeMode mode) { base.SetAutoSizeMode (mode); }
|
||||
#endif
|
||||
public void PublicSetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { base.SetBoundsCore (x, y, width, height, specified); }
|
||||
|
||||
@@ -1958,5 +1958,56 @@ namespace MonoTests.System.Windows.Forms
|
||||
return base.IsInputChar (charCode);
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // Should not throw IndexOutOfBoundsException
|
||||
public void ReaddingItem ()
|
||||
{
|
||||
Form form = new Form ();
|
||||
form.ShowInTaskbar = false;
|
||||
ListView lvw1 = new ListView ();
|
||||
ListView lvw2 = new ListView ();
|
||||
lvw1.View = View.Details;
|
||||
lvw2.View = View.Details;
|
||||
lvw1.Columns.Add (new ColumnHeader ("1"));
|
||||
lvw2.Columns.Add (new ColumnHeader ("2"));
|
||||
form.Controls.Add (lvw1);
|
||||
form.Controls.Add (lvw2);
|
||||
form.Show ();
|
||||
|
||||
for (int i = 0; i < 50; i++)
|
||||
lvw1.Items.Add ("A");
|
||||
lvw2.Items.Add ("B1");
|
||||
|
||||
ListViewItem item = lvw1.Items [lvw1.Items.Count - 1];
|
||||
item.Selected = true;
|
||||
item.Remove ();
|
||||
lvw2.Items.Add (item);
|
||||
item.Selected = true;
|
||||
|
||||
Assert.AreEqual (lvw1.Items.Count, 49, "#1");
|
||||
Assert.AreEqual (lvw2.Items.Count, 2, "#2");
|
||||
Assert.AreEqual (lvw2.Items [1].Selected, true, "#3");
|
||||
|
||||
form.Dispose ();
|
||||
}
|
||||
|
||||
[Test] // Should not throw ArgumentOutOfRangeException
|
||||
public void DeleteNotFocusedItem ()
|
||||
{
|
||||
Form form = new Form ();
|
||||
form.ShowInTaskbar = false;
|
||||
ListView lvw = new ListView ();
|
||||
form.Controls.Add (lvw);
|
||||
form.Show ();
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
lvw.Items.Add ("A");
|
||||
|
||||
lvw.Items [lvw.Items.Count - 1].Focused = true;
|
||||
lvw.Items [0].Remove ();
|
||||
lvw.Items [0].Remove ();
|
||||
|
||||
form.Dispose ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = child1.Anchor;
|
||||
child1.Anchor = AnchorStyles.Right;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.AutoScrollOffset;
|
||||
child1.AutoScrollOffset = new Point (40, 40);
|
||||
@@ -164,7 +164,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.AutoScrollMinSize = new Size (child1.AutoScrollMinSize.Width + 1, child1.AutoScrollMinSize.Height + 1);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FA9");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.AutoScrollOffset;
|
||||
child1.AutoScrollOffset = new Point (child1.AutoScrollOffset.X + 1, child1.AutoScrollOffset.Y + 1);
|
||||
@@ -180,7 +180,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = child1.AutoSize;
|
||||
child1.AutoSize = !child1.AutoSize;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FA12");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.AutoSizeMode;
|
||||
child1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
@@ -410,7 +410,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.HelpButton = !child1.HelpButton;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FH1");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.HorizontalScroll;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FH2");
|
||||
@@ -431,7 +431,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
SetUp ();
|
||||
o = child1.IsDisposed;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A43");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.IsMirrored;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A44");
|
||||
@@ -614,7 +614,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = child1.ParentForm;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FP1");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.RestoreBounds;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FR1");
|
||||
@@ -654,7 +654,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
SetUp ();
|
||||
o = child1.TopLevelControl;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A67");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.UseWaitCursor;
|
||||
child1.UseWaitCursor = true;
|
||||
@@ -732,7 +732,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.TransparencyKey = Color.BurlyWood;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FT4");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.VerticalScroll;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FV1");
|
||||
@@ -752,7 +752,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
// Not a surprise, but none of these cause handle creation.
|
||||
// Included just to absolutely certain.
|
||||
object o;
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.PublicCanRaiseEvents;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A1");
|
||||
@@ -803,7 +803,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = child1.PublicResizeRedraw;
|
||||
child1.PublicResizeRedraw = !child1.PublicResizeRedraw;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A13");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.PublicScaleChildren;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A14");
|
||||
@@ -1033,7 +1033,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.LayoutMdi (MdiLayout.Cascade);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F5");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.PerformAutoScale ();
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F6");
|
||||
@@ -1086,7 +1086,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.Validate ();
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F15");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.ValidateChildren ();
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F16");
|
||||
@@ -1144,7 +1144,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
SetUp ();
|
||||
child1.PublicGetAccessibilityObjectById (0);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.PublicGetAutoSizeMode ();
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A7");
|
||||
@@ -1240,7 +1240,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
SetUp ();
|
||||
child1.PublicRtlTranslateLeftRight (LeftRightAlignment.Left);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A30");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.PublicScaleControl (new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A31");
|
||||
@@ -1253,7 +1253,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.PublicSelect ();
|
||||
Assert.IsTrue (child1.IsHandleCreated, "A33");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.PublicSetAutoSizeMode (AutoSizeMode.GrowAndShrink);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A34");
|
||||
@@ -1363,7 +1363,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.PublicProcessTabKey (true);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F14");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.Controls.Add (new Control ());
|
||||
child1.PublicScrollToControl (child1.Controls [0]);
|
||||
@@ -1391,7 +1391,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
// Properties
|
||||
public SizeF PublicAutoScaleFactor { get { return base.AutoScaleFactor; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicCanRaiseEvents { get { return base.CanRaiseEvents; } }
|
||||
#endif
|
||||
public CreateParams PublicCreateParams { get { return base.CreateParams; } }
|
||||
@@ -1410,7 +1410,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public Rectangle PublicMaximizedBounds { get {return base.MaximizedBounds; } set { base.MaximizedBounds = value; }}
|
||||
public bool PublicRenderRightToLeft { get { return base.RenderRightToLeft; } }
|
||||
public bool PublicResizeRedraw { get { return base.ResizeRedraw; } set { base.ResizeRedraw = value; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicScaleChildren { get { return base.ScaleChildren; } }
|
||||
#endif
|
||||
public bool PublicShowFocusCues { get { return base.ShowFocusCues; } }
|
||||
@@ -1430,7 +1430,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public void PublicCreateHandle () { base.CreateHandle (); }
|
||||
public void PublicDestroyHandle () { base.DestroyHandle (); }
|
||||
public AccessibleObject PublicGetAccessibilityObjectById (int objectId) { return base.GetAccessibilityObjectById (objectId); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public AutoSizeMode PublicGetAutoSizeMode () { return base.GetAutoSizeMode (); }
|
||||
public Rectangle PublicGetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified) { return base.GetScaledBounds (bounds, factor, specified); }
|
||||
#endif
|
||||
@@ -1466,17 +1466,17 @@ namespace MonoTests.System.Windows.Forms
|
||||
public ContentAlignment PublicRtlTranslateContent (ContentAlignment align) { return base.RtlTranslateContent (align); }
|
||||
public HorizontalAlignment PublicRtlTranslateHorizontal (HorizontalAlignment align) { return base.RtlTranslateHorizontal (align); }
|
||||
public LeftRightAlignment PublicRtlTranslateLeftRight (LeftRightAlignment align) { return base.RtlTranslateLeftRight (align); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScaleControl (SizeF factor, BoundsSpecified specified) { base.ScaleControl (factor, specified); }
|
||||
#endif
|
||||
public void PublicScaleCore (float dx, float dy) { base.ScaleCore (dx, dy); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScrollToControl (Control activeControl) { base.ScrollToControl (activeControl); }
|
||||
#endif
|
||||
public void PublicSelect () { base.Select (); }
|
||||
public void PublicSelect (bool directed, bool forward) { base.Select (directed, forward); }
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicSetAutoSizeMode (AutoSizeMode mode) { base.SetAutoSizeMode (mode); }
|
||||
#endif
|
||||
public void PublicSetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { base.SetBoundsCore (x, y, width, height, specified); }
|
||||
|
||||
@@ -946,10 +946,10 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (31, p.GetRowHeights ()[0], "D1");
|
||||
Assert.AreEqual (31, p.GetRowHeights ()[1], "D2");
|
||||
Assert.AreEqual (81, p.GetColumnWidths ()[0], "D3");
|
||||
Assert.LessOrEqual (75, p.GetColumnWidths ()[1], "D4");
|
||||
Assert.GreaterOrEqual (78, p.GetColumnWidths ()[1], "D5");
|
||||
Assert.LessOrEqual (78, p.GetColumnWidths ()[2], "D6");
|
||||
Assert.GreaterOrEqual (81, p.GetColumnWidths ()[2], "D7");
|
||||
AssertHelper.LessOrEqual (75, p.GetColumnWidths ()[1], "D4");
|
||||
AssertHelper.GreaterOrEqual (78, p.GetColumnWidths ()[1], "D5");
|
||||
AssertHelper.LessOrEqual (78, p.GetColumnWidths ()[2], "D6");
|
||||
AssertHelper.GreaterOrEqual (81, p.GetColumnWidths ()[2], "D7");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -1702,7 +1702,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (4, tlp.RowCount, "X18638-1");
|
||||
Assert.AreEqual (3, tlp.ColumnCount, "X18638-2");
|
||||
Assert.AreEqual (60, widths[0], "X18638-3");
|
||||
Assert.Greater (label2.Width, widths[1], "X18638-5");
|
||||
AssertHelper.Greater (label2.Width, widths[1], "X18638-5");
|
||||
Assert.AreEqual (45, widths[2], "X18638-4");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user