use of com.android.tools.idea.uibuilder.model.NlModel in project android by JetBrains.
the class NlPropertyItemTest method testSetValueOnDisposedProject.
public void testSetValueOnDisposedProject() {
NlPropertyItem text = createFrom(myTextView, ATTR_TEXT);
// Make a fake project instance that reports true to isDisposed()
Project fakeProject = mock(Project.class);
when(fakeProject.isDisposed()).thenReturn(true);
NlModel fakeModel = mock(NlModel.class);
when(fakeModel.getProject()).thenReturn(fakeProject);
NlComponent fakeComponent = mock(NlComponent.class);
when(fakeComponent.getModel()).thenReturn(fakeModel);
when(fakeComponent.getTag()).thenThrow(new RuntimeException("setValue should bail out"));
NlPropertyItem fake = new NlPropertyItem(ImmutableList.of(fakeComponent), ANDROID_URI, text.getDefinition());
fake.setValue("stuff");
}
Aggregations