public void MapPath_RootedPathIsEqualToRelative()
        {
            var rootedPath   = EnvironmentExtensions.MapPath("~/my/test");
            var relativePath = EnvironmentExtensions.MapPath("my/test");

            Assert.AreEqual(Path.GetFullPath(rootedPath), Path.GetFullPath(relativePath));
        }
        public void MapPath_EmptyOrBlankIsBasePath()
        {
            var emptyMap = EnvironmentExtensions.MapPath(String.Empty);
            var blankMap = EnvironmentExtensions.MapPath("   ");
            var baseMap  = EnvironmentExtensions.MapPath("~");

            Assert.AreEqual(baseMap, emptyMap);
            Assert.AreEqual(baseMap, blankMap);
        }
 public void MapPath_MappedPathIsAlwaysRooted()
 {
     Assert.IsTrue(Path.IsPathRooted(EnvironmentExtensions.MapPath("~/my/test")));
     Assert.IsTrue(Path.IsPathRooted(EnvironmentExtensions.MapPath("my/test")));
     Assert.IsTrue(Path.IsPathRooted(EnvironmentExtensions.MapPath("C:/my/test")));
 }
        public void MapPath_BasePathIsAppDomainDirectory()
        {
            var basePath = EnvironmentExtensions.MapPath("~");

            Assert.AreEqual(AppDomain.CurrentDomain.BaseDirectory, basePath);
        }
 public void MapPath_NullString()
 {
     Assert.Throws <ArgumentNullException>(() => EnvironmentExtensions.MapPath(null));
 }