예제 #1
0
        public void GetEffectivePath_ProperConcatenation(string baseUriString, string pathSections, string specifiedPath, string expectedResult)
        {
            Uri baseUri = new Uri(baseUriString);

            Uri result = HttpState.GetEffectivePath(baseUri, pathSections, specifiedPath);

            Assert.Equal(expectedResult, result.ToString(), StringComparer.OrdinalIgnoreCase);
        }
예제 #2
0
        public void GetEffectivePath_NullBaseAddressAndNoPath_Throws()
        {
            HttpState httpState = SetupHttpState();

            httpState.BaseAddress = null;

            Assert.Throws <ArgumentNullException>("baseAddress", () => httpState.GetEffectivePath(""));
        }
예제 #3
0
 public void GetEffectivePath_NoBaseAddressOrAbsoluteUri_ThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => HttpState.GetEffectivePath(null, "", "/NotAnAbsoluteUri"));
 }