namespace Zeta.EnterpriseLibrary.UnitTests.Tests.Common { #region Using directives. // ---------------------------------------------------------------------- using EnterpriseLibrary.Common.IO; using NUnit.Framework; // ---------------------------------------------------------------------- #endregion ///////////////////////////////////////////////////////////////////////// [TestFixture] public sealed class PathHelperTest { #region Set up and tear down. // ------------------------------------------------------------------ [TestFixtureSetUp] public void TestFixtureSetUp() { //... } [TestFixtureTearDown] public void TestFixtureTearDown() { //... } [SetUp] public void SetUp() { //... } [TearDown] public void TearDown() { //... } // ------------------------------------------------------------------ #endregion #region Tests. // ------------------------------------------------------------------ [Test] public void Test01() { Assert.AreEqual( PathHelper.ConvertFilePathToFileUrl( @"C:\MyFolder\MyFile.txt" ), @"file:///C:/MyFolder/MyFile.txt" ); Assert.AreEqual( PathHelper.ConvertFilePathToFileUrl( @"\MyFolder\MyFile.txt" ), @"file:///MyFolder/MyFile.txt" ); Assert.AreEqual( PathHelper.ConvertFilePathToFileUrl( @"\\MyShare\MyFolder\MyFile.txt" ), @"file://MyShare/MyFolder/MyFile.txt" ); Assert.AreEqual( PathHelper.ConvertFilePathToFileUrl( string.Empty ), string.Empty ); Assert.AreEqual( PathHelper.ConvertFilePathToFileUrl( null ), null ); } // ------------------------------------------------------------------ #endregion } ///////////////////////////////////////////////////////////////////////// }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)