fix: Fixing test cases

This commit is contained in:
Chris Cameron
2018-05-11 15:57:04 -04:00
parent 3f8e2b8df7
commit cddc726d4d
2 changed files with 10 additions and 9 deletions

View File

@@ -31,7 +31,7 @@ namespace ICD.Common.Utils.Tests
Assert.AreEqual(fragment, new IcdUriBuilder { Path = fragment }.Path); Assert.AreEqual(fragment, new IcdUriBuilder { Path = fragment }.Path);
} }
[TestCase(80)] [TestCase((ushort)80)]
public void PortTest(ushort port) public void PortTest(ushort port)
{ {
Assert.AreEqual(port, new IcdUriBuilder { Port = port }.Port); Assert.AreEqual(port, new IcdUriBuilder { Port = port }.Port);
@@ -40,19 +40,19 @@ namespace ICD.Common.Utils.Tests
[TestCase("test")] [TestCase("test")]
public void QueryTest(string query) public void QueryTest(string query)
{ {
Assert.AreEqual(query, new IcdUriBuilder { Query = query }.Fragment); Assert.AreEqual(query, new IcdUriBuilder { Query = query }.Query);
} }
[TestCase("test")] [TestCase("test")]
public void SchemeTest(string scheme) public void SchemeTest(string scheme)
{ {
Assert.AreEqual(scheme, new IcdUriBuilder { Scheme = scheme }.Fragment); Assert.AreEqual(scheme, new IcdUriBuilder { Scheme = scheme }.Scheme);
} }
[TestCase("test")] [TestCase("test")]
public void UserNameTest(string userName) public void UserNameTest(string userName)
{ {
Assert.AreEqual(userName, new IcdUriBuilder { UserName = userName }.Fragment); Assert.AreEqual(userName, new IcdUriBuilder { UserName = userName }.UserName);
} }
[Test] [Test]
@@ -63,11 +63,11 @@ namespace ICD.Common.Utils.Tests
#endregion #endregion
[TestCase("http://localhost/", null, null, null, 0, null, null, null)] [TestCase("http://localhost/", null, null, null, (ushort)0, null, null, null)]
[TestCase("http://localhost:80/", null, null, null, 80, null, null, null)] [TestCase("http://localhost:80/", null, null, null, (ushort)80, null, null, null)]
[TestCase("http://username:@localhost/", null, null, null, 0, null, null, "username")] [TestCase("http://username@localhost/", null, null, null, (ushort)0, null, null, "username")]
[TestCase("http://:password@localhost/", null, null, "password", 0, null, null, null)] [TestCase("http://localhost/", null, null, "password", (ushort)0, null, null, null)]
[TestCase("https://localhost/", null, null, null, 0, null, "https", null)] [TestCase("https://localhost/", null, null, null, (ushort)0, null, "https", null)]
public void ToStringTest(string expected, string fragment, string address, string password, ushort port, string query, public void ToStringTest(string expected, string fragment, string address, string password, ushort port, string query,
string scheme, string userName) string scheme, string userName)
{ {

View File

@@ -72,6 +72,7 @@ namespace ICD.Common.Utils
// Scheme // Scheme
string scheme = string.IsNullOrEmpty(Scheme) ? "http" : Scheme; string scheme = string.IsNullOrEmpty(Scheme) ? "http" : Scheme;
builder.Append(scheme); builder.Append(scheme);
builder.Append(':');
// Authority // Authority
builder.Append("//"); builder.Append("//");