field.setBackground(Color.red);
MComponent component = new MComponentMock(field, "foo");
ComponentFinder resolver = ((MComponentMock) component).getDummyResolver();
field.setEnabled(true);
ActionTestCase.assertPasses(
new AssertAction(new ComponentId("text.name"), AssertAction.ENABLED, ScriptModelServerPart.getModelServerPart(),
WindowMonitor.getInstance()), resolver);
ActionTestCase.assertFails(
new AssertAction(new ComponentId("text.name"), AssertAction.DISABLED, ScriptModelServerPart.getModelServerPart(),
WindowMonitor.getInstance()), resolver);
field.setEnabled(false);
ActionTestCase.assertFails(
new AssertAction(new ComponentId("text.name"), AssertAction.ENABLED, ScriptModelServerPart.getModelServerPart(),
WindowMonitor.getInstance()), resolver);
ActionTestCase.assertPasses(
new AssertAction(new ComponentId("text.name"), AssertAction.DISABLED, ScriptModelServerPart.getModelServerPart(),
WindowMonitor.getInstance()), resolver);
}