Пример #1
0
 public virtual void TestCreateHardLinkMultEmptyList()
 {
     string[] emptyList = new string[] {  };
     //test the case of empty file list
     HardLink.CreateHardLinkMult(src, emptyList, tgt_mult);
     //check nothing changed in the directory tree
     ValidateSetup();
 }
Пример #2
0
 public virtual void TestCreateHardLinkMult()
 {
     //hardlink a whole list of three files at once
     string[] fileNames = src.List();
     HardLink.CreateHardLinkMult(src, fileNames, tgt_mult);
     //validate by link count - each file has been linked once,
     //so each count is "2"
     Assert.Equal(2, HardLink.GetLinkCount(x1));
     Assert.Equal(2, HardLink.GetLinkCount(x2));
     Assert.Equal(2, HardLink.GetLinkCount(x3));
     Assert.Equal(2, HardLink.GetLinkCount(x1_mult));
     Assert.Equal(2, HardLink.GetLinkCount(x2_mult));
     Assert.Equal(2, HardLink.GetLinkCount(x3_mult));
     //validate by contents
     ValidateTgtMult();
     //validate that change of content is reflected in the other linked files
     AppendToFile(x1_mult, str3);
     Assert.True(FetchFileContents(x1_mult).Equals(str1 + str3));
     Assert.True(FetchFileContents(x1).Equals(str1 + str3));
 }