Skip to content

Commit

Permalink
[System] Update mobile tests to reflect missing DesignerAttribute
Browse files Browse the repository at this point in the history
Fixes mono#8407
  • Loading branch information
marek-safar authored and monojenkins committed Jul 18, 2018
1 parent a98fecb commit 66414ae
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions mcs/class/System/Test/System.ComponentModel/TypeDescriptorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1096,13 +1096,14 @@ public void TestICustomTypeDescriptor ()
}

[Test]
#if FULL_AOT_RUNTIME
[Ignore ("https://github.com/mono/mono/issues/8407")]
#endif
public void TestCreateDesigner ()
{
IDesigner des = TypeDescriptor.CreateDesigner (com, typeof(int));
#if MOBILE
Assert.IsNull (des, "#1"); // We exclude DesignerAttribute on BCL types
#else
Assert.IsTrue (des is MyDesigner, "#1");
#endif

des = TypeDescriptor.CreateDesigner (com, typeof(string));
Assert.IsNull (des, "#2");
Expand Down Expand Up @@ -1132,31 +1133,37 @@ public void TestCreateProperty ()
}

[Test]
#if FULL_AOT_RUNTIME
[Ignore ("https://github.com/mono/mono/issues/8407")]
#endif
public void TestGetAttributes ()
{
AttributeCollection col = TypeDescriptor.GetAttributes (typeof(MyComponent));
Assert.IsNotNull (col [typeof (DescriptionAttribute)], "#A1");
#if !MOBILE
Assert.IsNotNull (col [typeof (DesignerAttribute)], "#A2");
#endif
Assert.IsNull (col [typeof (EditorAttribute)], "#A3");

col = TypeDescriptor.GetAttributes (com);
Assert.IsNotNull (col [typeof (DescriptionAttribute)], "#B1");
#if !MOBILE
Assert.IsNotNull (col [typeof (DesignerAttribute)], "#B2");
#endif
Assert.IsNull (col [typeof (EditorAttribute)], "#B3");

col = TypeDescriptor.GetAttributes (sitedcom);
Assert.IsNotNull (col [typeof (DescriptionAttribute)], "#C1");
#if !MOBILE
Assert.IsNotNull (col [typeof (DesignerAttribute)], "#C2");
#endif
Assert.IsNotNull (col [typeof (EditorAttribute)], "#C3");

col = TypeDescriptor.GetAttributes (nfscom);
Assert.IsNotNull (col [typeof (DescriptionAttribute)], "#D1");
#if !MOBILE
Assert.IsNotNull (col [typeof (DesignerAttribute)], "#D2");
#endif
Assert.IsNull (col [typeof (EditorAttribute)], "#D3");

#if !MOBILE
col = TypeDescriptor.GetAttributes (typeof (MyDerivedComponent));
Assert.IsNotNull (col [typeof (DesignerAttribute)], "#E1");
Assert.IsNotNull (col [typeof (DescriptionAttribute)], "#E2");
Expand All @@ -1177,6 +1184,7 @@ public void TestGetAttributes ()
// Shows that attributes are retrieved from the current type, the base types
// and the implemented by the type interfaces.
Assert.AreEqual (3, TypeDescriptor.GetAttributes (typeof (TestDerivedClass)).Count, "#F1");
#endif
}

[Test]
Expand Down

0 comments on commit 66414ae

Please sign in to comment.