[Test]
public void TestGetComponentName ()
{
- AssertNull ("t1", TypeDescriptor.GetComponentName (com));
+ AssertNotNull ("t1", TypeDescriptor.GetComponentName (com));
AssertEquals ("t1", "TestName", TypeDescriptor.GetComponentName (sitedcom));
}
des = TypeDescriptor.GetDefaultEvent (sitedcom);
AssertNotNull ("t3", des);
- AssertEquals ("t4", "AnEvent", des.Name);
+ AssertEquals ("t4", "AnotherEvent", des.Name);
}
[Test]
des = TypeDescriptor.GetDefaultProperty (com);
AssertNull ("t2", des);
- des = TypeDescriptor.GetDefaultProperty (sitedcom);
+ }
+
+ [Test]
+ [Ignore("Fails on .NET")]
+ public void TestGetDefaultProperty2 ()
+ {
+ PropertyDescriptor des = TypeDescriptor.GetDefaultProperty (sitedcom);
AssertNotNull ("t3", des);
AssertEquals ("t4", "TestProperty", des.Name);
}
Assert ("t2.1", col.Find ("TestProperty", true) != null);
Assert ("t2.2", col.Find ("AnotherProperty", true) != null);
- col = TypeDescriptor.GetProperties (sitedcom);
- Assert ("t3.1", col.Find ("TestProperty", true) == null);
- Assert ("t3.2", col.Find ("AnotherProperty", true) != null);
-
Attribute[] filter = new Attribute[] { new DescriptionAttribute ("test") };
col = TypeDescriptor.GetProperties (typeof(MyComponent), filter);
Assert ("t5.1", col.Find ("TestProperty", true) != null);
Assert ("t5.2", col.Find ("AnotherProperty", true) == null);
+ }
+
+ [Test]
+ [Ignore("Fails on .NET")]
+ public void TestGetProperties2 ()
+ {
+ PropertyDescriptorCollection col = TypeDescriptor.GetProperties (sitedcom);
+ Assert ("t3.1", col.Find ("TestProperty", true) == null);
+ Assert ("t3.2", col.Find ("AnotherProperty", true) != null);
+
+ Attribute[] filter = new Attribute[] { new DescriptionAttribute ("test") };
col = TypeDescriptor.GetProperties (sitedcom, filter);
Assert ("t6.1", col.Find ("TestProperty", true) == null);
Assert ("t6.2", col.Find ("AnotherProperty", true) == null);
}
+
}
}
}
[Test]
-// [ExpectedException (typeof (UriFormatException))]
+ [Category("NotDotNet")]
public void UncFail ()
{
Uri uri = new Uri ("/home/user/dir/filename.ext");
}
[Test]
- public void CheckHostName ()
+ [Category("NotDotNet")]
+ public void CheckHostName1 ()
+ {
+ AssertEquals ("#11: known to fail with ms.net: this is not a valid domain address", UriHostNameType.Unknown, Uri.CheckHostName ("www.contoso.com."));
+ AssertEquals ("#33 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName ("2001::03A0:1.2.3.4"));
+ AssertEquals ("#36 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName (":11:22:33:44:55:66:77:88"));
+ }
+
+ [Test]
+ public void CheckHostName2 ()
{
AssertEquals ("#1", UriHostNameType.Unknown, Uri.CheckHostName (null));
AssertEquals ("#2", UriHostNameType.Unknown, Uri.CheckHostName (""));
AssertEquals ("#8", UriHostNameType.Dns, Uri.CheckHostName ("9001.002.03.4"));
AssertEquals ("#9", UriHostNameType.Dns, Uri.CheckHostName ("www.contoso.com"));
AssertEquals ("#10", UriHostNameType.Unknown, Uri.CheckHostName (".www.contoso.com"));
- AssertEquals ("#11: known to fail with ms.net: this is not a valid domain address", UriHostNameType.Unknown, Uri.CheckHostName ("www.contoso.com."));
AssertEquals ("#12", UriHostNameType.Dns, Uri.CheckHostName ("www.con-toso.com"));
AssertEquals ("#13", UriHostNameType.Dns, Uri.CheckHostName ("www.con_toso.com"));
AssertEquals ("#14", UriHostNameType.Unknown, Uri.CheckHostName ("www.con,toso.com"));
AssertEquals ("#31", UriHostNameType.Unknown, Uri.CheckHostName ("2001::03A0::/35"));
AssertEquals ("#32", UriHostNameType.Unknown, Uri.CheckHostName ("2001:03A0::/35a"));
- AssertEquals ("#33 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName ("2001::03A0:1.2.3.4"));
AssertEquals ("#34", UriHostNameType.Unknown, Uri.CheckHostName ("::ffff:123.256.155.43"));
AssertEquals ("#35", UriHostNameType.Unknown, Uri.CheckHostName (":127.0.0.1"));
- AssertEquals ("#36 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName (":11:22:33:44:55:66:77:88"));
AssertEquals ("#37", UriHostNameType.Unknown, Uri.CheckHostName ("::11:22:33:44:55:66:77:88"));
AssertEquals ("#38", UriHostNameType.Unknown, Uri.CheckHostName ("11:22:33:44:55:66:77:88::"));
AssertEquals ("#39", UriHostNameType.Unknown, Uri.CheckHostName ("11:22:33:44:55:66:77:88:"));
}
[Test]
- public void IsLoopback ()
+ [Category("NotDotNet")]
+ public void IsLoopback1 ()
+ {
+ Uri uri = new Uri("http://[0:0:0:0::127.11.22.33]:8080");
+ Assert ("#10: known to fail with ms.net", uri.IsLoopback);
+ uri = new Uri("http://[::ffff:127.11.22.33]:8080");
+ Assert ("#11: known to fail with ms.net", uri.IsLoopback);
+ }
+
+ [Test]
+ public void IsLoopback2 ()
{
Uri uri = new Uri("http://loopback:8080");
AssertEquals ("#1", true, uri.IsLoopback);
AssertEquals ("#8", true, uri.IsLoopback);
uri = new Uri("http://[0:0:0:0::127.0.0.1]:8080");
AssertEquals ("#9", true, uri.IsLoopback);
- uri = new Uri("http://[0:0:0:0::127.11.22.33]:8080");
- AssertEquals ("#10: known to fail with ms.net", true, uri.IsLoopback);
- uri = new Uri("http://[::ffff:127.11.22.33]:8080");
- AssertEquals ("#11: known to fail with ms.net", true, uri.IsLoopback);
uri = new Uri("http://[::ff00:7f11:2233]:8080");
AssertEquals ("#12", false, uri.IsLoopback);
uri = new Uri("http://[1:0:0:0::1]:8080");
}
[Test]
- public void Equals ()
+ [Category("NotDotNet")]
+ public void Equals1 ()
+ {
+ Uri uri1 = new Uri ("http://www.contoso.com/index.htm#main");
+ Uri uri2 = new Uri ("http://www.contoso.com/index.htm?x=1");
+ Assert ("#2 known to fail with ms.net", !uri1.Equals (uri2));
+ Assert ("#4: known to fail with ms.net", !uri1.Equals ("http://www.contoso.com:8080/index.htm?x=1"));
+ }
+
+ [Test]
+ public void Equals2 ()
{
Uri uri1 = new Uri ("http://www.contoso.com/index.htm#main");
Uri uri2 = new Uri ("http://www.contoso.com/index.htm#fragment");
Assert ("#1", uri1.Equals (uri2));
- uri2 = new Uri ("http://www.contoso.com/index.htm?x=1");
- Assert ("#2 known to fail with ms.net", !uri1.Equals (uri2));
Assert ("#3", !uri2.Equals ("http://www.contoso.com/index.html?x=1"));
- Assert ("#4: known to fail with ms.net", !uri1.Equals ("http://www.contoso.com:8080/index.htm?x=1"));
}
[Test]
// Empty path == localhost, in theory
path = "file:///tmp/foo/bar";
fileUri = new Uri( path );
- AssertEquals (path, "/tmp/foo/bar", fileUri.AbsolutePath);
+ AssertEquals (path, "/foo/bar", fileUri.AbsolutePath);
// Empty path == localhost, in theory
path = "file:///c:/tmp/foo/bar";