}
@Test
public void testSetterAndGetter() {
MockitoAnnotations.initMocks(this);
TransUnit transUnit = TestFixture.makeTransUnit(1);
TransUnitReplaceInfo info =
new TransUnitReplaceInfo(CONTAINING_DOC_ID, transUnit);
// init state
assertThat(info.getDocId(), Matchers.equalTo(CONTAINING_DOC_ID));
assertThat(info.getPreview(), Matchers.nullValue());
assertThat(info.getPreviewState(),
Matchers.equalTo(PreviewState.NotFetched));
assertThat(info.getReplaceInfo(), Matchers.nullValue());
assertThat(info.getReplaceState(),
Matchers.equalTo(ReplacementState.NotReplaced));
assertThat(info.getTransUnit(), Matchers.sameInstance(transUnit));
// update state
info.setPreview(updatePreview);
info.setPreviewState(PreviewState.Show);
info.setReplaceInfo(updateInfo);
info.setReplaceState(ReplacementState.Replaced);
TransUnit newTU = TestFixture.makeTransUnit(2);
info.setTransUnit(newTU);
assertThat(info.getPreview(), Matchers.sameInstance(updatePreview));
assertThat(info.getPreviewState(), Matchers.equalTo(PreviewState.Show));
assertThat(info.getReplaceInfo(), Matchers.sameInstance(updateInfo));