public void CreateCombinedUrlShouldSucceedForFileFormat() { string baseUrl = "file://levelup"; string addendum = "blah.txt"; string expectedCombination = "file://levelup/blah.txt"; Assert.AreEqual(RestSharpUtils.CreateCombinedUrl(baseUrl, addendum), expectedCombination); }
public void CreateCombinedUrlShouldFailForInvalidFormat() { string baseUrl = "levelup"; string addendum = @"\blah"; Assert.Throws <UriFormatException>(() => { RestSharpUtils.CreateCombinedUrl(baseUrl, addendum); }); }
public void CreateCombinedUrlShouldSucceed() { string baseUrlWithTrailingSlash = "http://test.thelevelup.com/"; string baseUrlWithOutTrailingSlash = "http://test.thelevelup.com"; string addendumWithLeadingSlash = "/blah"; string addendumWithoutLeadingSlash = "blah"; string expectedCombination = "http://test.thelevelup.com/blah"; Assert.AreEqual(RestSharpUtils.CreateCombinedUrl(baseUrlWithTrailingSlash, addendumWithLeadingSlash), expectedCombination); Assert.AreEqual(RestSharpUtils.CreateCombinedUrl(baseUrlWithTrailingSlash, addendumWithoutLeadingSlash), expectedCombination); Assert.AreEqual(RestSharpUtils.CreateCombinedUrl(baseUrlWithOutTrailingSlash, addendumWithLeadingSlash), expectedCombination); Assert.AreEqual(RestSharpUtils.CreateCombinedUrl(baseUrlWithOutTrailingSlash, addendumWithoutLeadingSlash), expectedCombination); }