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(); }
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(); }
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(); }
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(); }
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(); }
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(); }