Exemplo n.º 1
0
    public void Constructor_ValidRelativePath()
    {
      var directoryInfo = new DirectoryInfo(@"c:\temp");

      var node = new FolderDirectoryTreeNode(directoryInfo, "../");

      Assert.AreEqual(@"../", node.RelativePathFromRoot);
    }
Exemplo n.º 2
0
    public void Constructor_ValidFileSystemInfo_SetsOriginalLocationUrl()
    {
      var directoryInfo = new DirectoryInfo(@"c:\temp");

      var node = new FolderDirectoryTreeNode(directoryInfo, "");

      Assert.AreEqual(@"file:///c:/temp/", node.OriginalLocationUrl.ToString());
    }
Exemplo n.º 3
0
    public void Constructor_ValidFileSystemInfo_SetsOriginalLocation()
    {
      var directoryInfo = new DirectoryInfo(@"c:\temp");

      var node = new FolderDirectoryTreeNode(directoryInfo, "");

      Assert.AreEqual(@"c:\temp", node.OriginalLocation.FullName);
    }
Exemplo n.º 4
0
    public void GetRelativeUriTo_DirectoryToFileOutside_ReturnsRelativePath()
    {
      var directoryInfo = new DirectoryInfo(@"c:\temp");

      var node = new FolderDirectoryTreeNode(directoryInfo, "../");

      string relative = node.GetRelativeUriTo(new Uri(@"file:///c:/temp2/test2.html"));

      Assert.AreEqual("../temp/", relative);
    }
Exemplo n.º 5
0
    public void GetRelativeUriTo_FileToDirectory_ReturnsNodesFileName()
    {
      var fileInfo = new FileInfo(@"c:\temp\test1.html");

      var node = new FolderDirectoryTreeNode(fileInfo, "../");

      string relative = node.GetRelativeUriTo(new Uri(@"file:///c:/temp/"));

      Assert.AreEqual("test1.html", relative);
    }
        public void GetRelativeUriTo_DirectoryToParentDirectory_ReturnsRelativePath()
        {
            var directoryInfo = new DirectoryInfo(@"c:\temp\child");

            var node = new FolderDirectoryTreeNode(directoryInfo, "../");

            string relative = node.GetRelativeUriTo(new Uri(@"file:///c:/temp/"));

            Assert.AreEqual("child/", relative);
        }
Exemplo n.º 7
0
    public void RealData()
    {
      var originalLocation =
        new DirectoryInfo(
          @"C:\tfs\Dev.CAX\src\CAX_Main\src\net\Projects\Aim.Gain.GoldenCopy.FunctionalTesting\CAX\DistributionOfRights");

      var node = new FolderDirectoryTreeNode(originalLocation, "");
      
      var other = new Uri("file:///C:/tfs/Dev.CAX/src/CAX_Main/src/net/Projects/Aim.Gain.GoldenCopy.FunctionalTesting/CAX/");

      string relative = node.GetRelativeUriTo(other);

      Assert.AreEqual("DistributionOfRights/", relative);
    }