在以下测试中,为什么(仅)最后一个测试失败?
[Fact]
public void IsWellFormedUriString_AbsolutNonHashTagUri_ReturnsTrue()
{
Assert.True(Uri.IsWellFormedUriString("http://www.RegularSite.org/Home", UriKind.Absolute));
}
[Fact]
public void IsWellFormedUriString_RelativeNonHashTagUri_ReturnsTrue()
{
Assert.True(Uri.IsWellFormedUriString("Home", UriKind.Relative));
}
[Fact]
public void IsWellFormedUriString_AbsolutHashTagUri_ReturnsTrue()
{
Assert.True(Uri.IsWellFormedUriString("http://www.w3.org/#!Home", UriKind.Absolute));
}
[Fact]
public void IsWellFormedUriString_RelativeHashTagUri_ReturnsTrue()
{
// Fails!
Assert.True(Uri.IsWellFormedUriString("#!Home", UriKind.Relative));
}
如果在 Absolute 版本中Uri
识别HashbangsIsWellFormedUriString
,为什么在 Relative 版本中不识别?我错过了什么?
注意:这没有帮助。