## Compare With Each Other

Since:
Last Modified: $Date: 2007/09/05 19:30:00 $

### Compare a resource with other resource

##### The action

- The action should appear only when there are 2 or 3 resources selected.
- If there are 3 resources selected you should be prompted to select the common ancestor.

##### Look

- Ensure that all titles and labels are ok (e.g. dialog title, structure pane title, compare editor labels...).
- Ensure that all buttons in the toolbar are properly enabled (e.g. Copy All/Copy Current, Next/Prev Difference/Change).
- Ensure that difference markers are properly display at start

##### Navigation

- If you reach the first/last difference you should be prompted to go to the end/start of the current element.
- Ensure that you can correctly navigate through differences using the difference markers on the right side of the editor.

##### Merging

- Ensure that Copy All/Copy Current actions work as expected.
- Ensure that when the Copy All action is used all difference markers disappear.
- Ensure that when the Copy Current action is used a proper difference marker disappears.
- Ensure you can Undo an action.

##### Saving

- If you edit a local resource the dirty state indicator should appear over the resource.
- If you edit a local resource and the resource is also opened in a different editor the dirty state should appear on that editor too.
- If you edit both of the resources being compare (both are local), changes should be saved to both of them.
- If you edit a resource and close the editor you should be prompted to save or abandon changes.
- If you edit both of the resources and close the editor you should be prompted to select which resources to save using the Save Resources dialog.
- Ensure you can Undo a change.
- Ensure that changes are saved correctly to the underlying resource.

##### Concurrent edition

- Scenario 1
  1. Compare two local resources using the Compare Editor.
  2. Open one of them in the default editor (F3) and edit it.
  3. Ensure that the resource gets the dirty state indicator over both editors (i.e default and Compare).
  4. If you save the resource in the default editor the dirty state indicator should go off for both editors.
  5. Ensure that changes are saved correctly to the underlying resource.
- Scenario 2a
  1. Compare two local resources using the Compare Editor.
  2. Open one of them in the default editor (F3) and edit it.
  3. Ensure that the resource gets the dirty state indicator over both editors (i.e default and Compare).
  4. If you close the default editor you should be prompted to save changes, exiting without saving or cancel.
  5. Select exit without saving (button named "No").
  6. Ensure that the resource under the Compare Editor is still in the dirty state.
  7. Ensure that changes are the same as made using the default editor.
  8. Ensure that changes can be saved to the underlying resource from the Compare Editor.
  9. Ensure that changes are saved correctly to the underlying resource.
- Scenario 2b
  1. Compare two local resources using the Compare Editor.
  2. Open one of them in the default editor (F3) and edit it.
  3. Ensure that the resource gets the dirty state indicator over both editors (i.e default and Compare).
  4. If you close the default editor you should be prompted to save changes, exiting without saving or cancel.
  5. Select to save changes (button named "Yes").
  6. Ensure that the dirty state indicator for the resource goes off.
  7. Ensure that changes are saved correctly to the underlying resource.
  8. Ensure you can Undo changes.
- Scenario 3
  1. Compare two local resources using the Compare Editor.
  2. Open both files in default editors (F3) and edit them.
  3. Ensure that the resource gets the dirty state indicator over all editors (i.e two default and Compare).
  4. Ensure that changes made in one of editors are correctly handled by others.
  5. Ensure that changes are saved correctly to underlying resources.
  6. Ensure you can Undo changes.

##### Common Ancestor

- Ensure that a resource acting as a common ancestor is the one selected in the dialog.
- Ensure you can switch between Two- and Three-way compare when a common ancestor is available.
- Ensure you can show/hide the Common Ancestor Pane.