Пример #1
0
        public void ReturnSiteRelativeAddressGivenBaseUrlNull()
        {
            var config  = new AlternateWebRootConfiguration();
            var address = "~/myfile.png";
            var result  = AlternateWebRoot.Apply(address, config);

            Assert.AreEqual(address.Substring(1), result);
        }
Пример #2
0
        public void ReturnValueGivenIsIncludingSiteRelativePaths(string baseAddress, string relativeAddress, string expectedAddress)
        {
            var config = new AlternateWebRootConfiguration
            {
                BaseUrl = new Uri(baseAddress),
                IsIncludingSiteRelativePaths = true,
            };
            var result = AlternateWebRoot.Apply(relativeAddress, config);

            Assert.AreEqual(expectedAddress, result);
        }
Пример #3
0
 public void ThrowExceptionGivenNullAddress()
 {
     AlternateWebRoot.Apply(null);
     Assert.Fail("An exception should have been thrown.");
 }