public void op_ToPath_FileSystemInfo_whenHttpQueryBackslash() { AbsoluteUri obj = @"http://example.com/foo/bar?q=a\b"; var expected = new DirectoryInfo(Path.Combine(Path.GetTempPath(), @"http\example.com\foo\bar?q=a\b")); var actual = obj.ToPath(new DirectoryInfo(Path.GetTempPath())); Assert.Equal(expected.FullName, actual.FullName); }
public void op_ToPath_FileSystemInfo_whenHttpQueryVerticalBar() { AbsoluteUri obj = "http://example.com/foo/bar?q=4|5"; var expected = new DirectoryInfo(Path.Combine(Path.GetTempPath(), @"http\example.com\foo\bar?q=4|5")); var actual = obj.ToPath(new DirectoryInfo(Path.GetTempPath())); Assert.Equal(expected.FullName, actual.FullName); }
public void op_ToPath_FileSystemInfo_whenTel() { AbsoluteUri obj = "tel:+441234555666"; var expected = new DirectoryInfo(Path.Combine(Path.GetTempPath(), @"tel\+441234555666")); var actual = obj.ToPath(new DirectoryInfo(Path.GetTempPath())); Assert.Equal(expected.FullName, actual.FullName); }
public void op_ToPath_FileSystemInfo_whenUrn() { AbsoluteUri obj = "urn://example.com"; var expected = new DirectoryInfo(Path.Combine(Path.GetTempPath(), @"urn\example.com\")); var actual = obj.ToPath(new DirectoryInfo(Path.GetTempPath())); Assert.Equal(expected.FullName, actual.FullName); }
public void op_GetHashCode() { var obj = new AbsoluteUri("http://example.com/"); var expected = obj.ToString().GetHashCode(); var actual = obj.GetHashCode(); Assert.Equal(expected, actual); }
public void op_ToPath_FileSystemInfo() { AbsoluteUri obj = "http://example.com/foo/bar?x=1&y=2#fragment"; var expected = new DirectoryInfo(Path.Combine(Path.GetTempPath(), @"http\example.com\foo\bar?x=1&y=2#fragment")); var actual = obj.ToPath(new DirectoryInfo(Path.GetTempPath())); Assert.Equal(expected.FullName, actual.FullName); }
public void op_CompareTo_objectSame() { var obj = new AbsoluteUri("http://example.com/"); const int expected = 0; var actual = obj.CompareTo(obj as object); Assert.Equal(expected, actual); }
public void op_CompareTo_AbsoluteUriEqual() { var obj = new AbsoluteUri("http://example.com/"); var comparand = new AbsoluteUri("http://example.com/"); const int expected = 0; var actual = obj.CompareTo(comparand); Assert.Equal(expected, actual); }
public void op_CompareTo_objectLesser() { var obj = new AbsoluteUri("http://example.net/"); object comparand = new AbsoluteUri("http://example.com/"); const int expected = 11; var actual = obj.CompareTo(comparand); Assert.Equal(expected, actual); }
public void ctor_SerializationInfo_StreamingContext() { var expected = new AbsoluteUri("http://example.com"); AbsoluteUri actual; using (Stream stream = new MemoryStream()) { var formatter = new BinaryFormatter(); formatter.Serialize(stream, new AbsoluteUri("http://example.com")); stream.Position = 0; actual = (AbsoluteUri)formatter.Deserialize(stream); } Assert.Equal(expected, actual); }
public void op_ToPath_FileSystemInfoNull() { AbsoluteUri obj = "http://example.com/"; Assert.Throws <ArgumentNullException>(() => obj.ToPath(null)); }
public void op_Equals_objectSame() { var obj = new AbsoluteUri("http://example.com/"); Assert.True(obj.Equals(obj as object)); }
public void opLesserThan_AbsoluteUri_AbsoluteUriNull() { var obj = new AbsoluteUri("http://example.com/"); Assert.False(obj < null); }
public void opLesserThan_AbsoluteUriNull_AbsoluteUri() { var comparand = new AbsoluteUri("http://example.com/"); Assert.True(null < comparand); }
public void opGreaterThan_AbsoluteUri_AbsoluteUriNull() { var obj = new AbsoluteUri("http://example.com/"); Assert.True(obj > null); }
public void opGreaterThan_AbsoluteUriNull_AbsoluteUri() { var comparand = new AbsoluteUri("http://example.com/"); Assert.False(null > comparand); }