public void Scheme(UrlTestData urlData) { // Fixture setup // Exercise system var url = AbsoluteUrl.Create(urlData.Url); // Verify outcome Assert.Equal(urlData.Scheme, url.Scheme); // Teardown }
public void HasParameter(string urlText, string parameter, bool expectedResult) { // Fixture setup // Exercise system var url = AbsoluteUrl.Create(urlText); // Verify outcome Assert.Equal(expectedResult, url.HasParameter(parameter)); // Teardown }
public void IsHttps_AbsoluteUrl(string urlText, bool expectedResult) { // Fixture setup // Exercise system var url = AbsoluteUrl.Create(urlText); // Verify outcome Assert.Equal(expectedResult, url.IsHttps); // Teardown }
public void Normalized(UrlTestData urlData) { // Fixture setup // Exercise system var url = AbsoluteUrl.Create(urlData.Url); // Verify outcome Assert.Equal(urlData.Normalized, url.ToString()); // Teardown }
//[InlineData("http://192.168.1.1/", true)] public void IsDomainIPAddress(string urlText, bool expectedIsIPAddress) { // Fixture setup // Exercise system var url = AbsoluteUrl.Create(urlText); // Verify outcome Assert.Equal(expectedIsIPAddress, url.IsDomainAnIPAddress); // Teardown }
public void SecondLevelDomain(string urlText, string expectedSecondLevelDomain) { // Fixture setup // Exercise system var url = AbsoluteUrl.Create(urlText); // Verify outcome Assert.Equal(expectedSecondLevelDomain, url.SecondLevelDomain); // Teardown }
public void Fragment(UrlTestData urlData) { // Fixture setup // Exercise system var url = AbsoluteUrl.Create(urlData.Url); // Verify outcome Assert.Equal(urlData.Fragment, url.Fragment); // Teardown }
public void RemoveParameter(string urlText, string parameter, string expectedQuery, string expectedPathAndQuery, string expectedPathAndQueryAndFragment) { // Fixture setup // Exercise system var url = AbsoluteUrl.Create(urlText).RemoveParameter(parameter); // Verify outcome Assert.Equal(expectedQuery, url.Query); Assert.Equal(expectedPathAndQuery, url.PathAndQuery); Assert.Equal(expectedPathAndQueryAndFragment, url.PathAndQueryAndFragment); // Teardown }
public void FileName_HasFileName_And_Extension_HasExtension(string urlText, string expectedFileName, bool expectedHasFileName, string expectedExtension, bool expectedHasExtension) { // Fixture setup // Exercise system var url = AbsoluteUrl.Create(urlText); // Verify outcome Assert.Equal(expectedFileName, url.FileName); Assert.Equal(expectedHasFileName, url.HasFileName); Assert.Equal(expectedExtension, url.Extension); Assert.Equal(expectedHasExtension, url.HasExtension); // Teardown }
public void Create() { // Fixture setup // Exercise system var url = AbsoluteUrl.Create("http://*****:*****@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose"); // Verify outcome Assert.Equal("http", url.Scheme); Assert.Equal("username:password", url.UserInfo); Assert.Equal("example.com", url.Host); Assert.Equal(8042, url.Port); Assert.Equal("/over/there/index.dtb", url.Path); Assert.Equal("type=animal&name=narwhal", url.Query); Assert.Equal("nose", url.Fragment); Assert.Equal("index.dtb", url.FileName); Assert.Equal(".dtb", url.Extension); // Teardown }