Exemplo n.º 1
0
        public void TestRenameMultiple004()
        {
            var fse1Name = "Windows";
            var fse1Path = "C:";
            var fse2Name = "Linux";
            var fse2Path = "D:";

            var fse1 = new FileSystemElement(fse1Name, fse1Path, DateTimeOffset.Now, 500);
            var fse2 = new FileSystemElement(fse2Name, fse2Path, DateTimeOffset.Now, 500);

            hs.AddCreateOperation(fse1);
            hs.AddCreateOperation(fse2);

            var newName1_1 = RenameElement(fse1);

            hs.AddRenameOperation(fse1, fse1Name);

            var newName2_1 = RenameElement(fse2);

            hs.AddRenameOperation(fse2, fse1Name);

            var newName1_2 = RenameElement(fse1);

            hs.AddRenameOperation(fse1, newName1_1);

            var h1 = hs.GetHistory(fse1).ToList();
            var h2 = hs.GetHistory(fse2).ToList();

            CompareOperations(
                new List <IFileSystemElementOperation> {
                new FileSystemElementCreateOperation(),
                new FileSystemElementRenameOperation(),
                new FileSystemElementRenameOperation(),
            },
                h1,
                false
                );

            CompareOperations(
                new List <IFileSystemElementOperation> {
                new FileSystemElementCreateOperation(),
                new FileSystemElementRenameOperation(),
            },
                h2,
                false
                );
        }