示例#1
0
        public void RollbackAddTest()
        {
            MigrationItemStrings sourceFile = new MigrationItemStrings("a.txt", null, TestEnvironment, true);

            int AddChangesetId = SourceAdapter.AddFile(sourceFile.LocalPath);

            // 2. Rollback the Add
            SourceAdapter.Rollback(AddChangesetId, AddChangesetId);

            RunAndValidate();
        }
示例#2
0
        public void RollbackRenameTest()
        {
            MigrationItemStrings sourceFile = new MigrationItemStrings("a.txt", "b.txt", TestEnvironment, true);

            SourceAdapter.AddFile(sourceFile.LocalPath);

            // 1. rename a.txt
            int renameChangesetId = SourceAdapter.RenameItem(sourceFile.ServerPath, sourceFile.NewServerPath);

            // 2. Rollback the rename
            SourceAdapter.Rollback(renameChangesetId, renameChangesetId);

            RunAndValidate();
        }
示例#3
0
        public void RollbackUnDeleteTest()
        {
            string fileName = "a.txt";
            MigrationItemStrings sourceFile = new MigrationItemStrings(fileName, null, TestEnvironment, true);

            SourceAdapter.AddFile(sourceFile.LocalPath);

            // 1. delete a.txt
            int deleteChangesetId = SourceAdapter.DeleteItem(sourceFile.LocalPath);

            // 2. Rollback the delete
            SourceAdapter.Rollback(deleteChangesetId, deleteChangesetId);

            RunAndValidate();
        }
示例#4
0
        public void RollbackEditTest()
        {
            string fileName = "a.txt";
            MigrationItemStrings sourceFile = new MigrationItemStrings(fileName, null, TestEnvironment, true);

            SourceAdapter.AddFile(sourceFile.LocalPath);

            // 1. Edit a.txt
            int editChangesetId = SourceAdapter.EditFile(sourceFile.LocalPath);

            // 2. Rollback the edit
            SourceAdapter.Rollback(editChangesetId, editChangesetId);

            RunAndValidate();
        }
示例#5
0
        public void RollbackUndeleteEditTest()
        {
            MigrationItemStrings sourceFile = new MigrationItemStrings("a.txt", null, TestEnvironment, true);

            SourceAdapter.AddFile(sourceFile.LocalPath);

            // 1. edit a.txt
            int editChangesetId = SourceAdapter.EditFile(sourceFile.LocalPath);

            int deleteChangesetId = SourceAdapter.DeleteItem(sourceFile.LocalPath);

            // 2. Rollback the edit
            SourceAdapter.Rollback(editChangesetId, deleteChangesetId);

            RunAndValidate();
        }
示例#6
0
        public void RollbackEditDeleteTest()
        {
            MigrationItemStrings sourceFile = new MigrationItemStrings("a.txt", null, TestEnvironment, true);

            SourceAdapter.AddFile(sourceFile.LocalPath);

            int deleteChangesetId = SourceAdapter.DeleteItem(sourceFile.LocalPath);

            int deletionId = SourceWorkspace.VersionControlServer.GetChangeset(deleteChangesetId).Changes[0].Item.DeletionId;

            SourceWorkspace.Get();
            SourceWorkspace.PendUndelete(sourceFile.ServerPath, deletionId);

            TestUtils.EditRandomFile(sourceFile.LocalPath);
            SourceWorkspace.PendEdit(sourceFile.LocalPath);
            int editChangesetId = SourceWorkspace.CheckIn(SourceWorkspace.GetPendingChanges(), "UndeleteEdit");

            // 2. Rollback the undelete|edit
            SourceAdapter.Rollback(editChangesetId, editChangesetId);

            RunAndValidate();
        }