added a check so the 'ensure' wont fail if the path is already as it should be.

added unit test for this method.
This commit is contained in:
Claus
2017-02-10 09:25:16 +01:00
parent bb31eb7c35
commit 7889f82a9a
2 changed files with 13 additions and 2 deletions

View File

@@ -56,5 +56,14 @@ namespace Umbraco.Tests.IO
Assert.AreEqual(IOHelper.MapPath(SystemDirectories.WebServices, true), IOHelper.MapPath(SystemDirectories.WebServices, false));
Assert.AreEqual(IOHelper.MapPath(SystemDirectories.Xslt, true), IOHelper.MapPath(SystemDirectories.Xslt, false));
}
[Test]
public void EnsurePathIsApplicationRootPrefixed()
{
//Assert
Assert.AreEqual("~/Views/Template.cshtml", IOHelper.EnsurePathIsApplicationRootPrefixed("Views/Template.cshtml"));
Assert.AreEqual("~/Views/Template.cshtml", IOHelper.EnsurePathIsApplicationRootPrefixed("/Views/Template.cshtml"));
Assert.AreEqual("~/Views/Template.cshtml", IOHelper.EnsurePathIsApplicationRootPrefixed("~/Views/Template.cshtml"));
}
}
}