@Test public void testSetValueAttribute() { String newValue = getRandomChars(20); // expect focusing element inputElementMock.focus(); // expect setting new attribute value inputElementMock.setValue(newValue); // perform test replayAll(); adapter.setValueAttribute(newValue); verifyAll(); }
@Test public void testGetValueAttribute() { String expectedValue = getRandomChars(20); // expect getting attribute value expect(inputElementMock.getValue()).andReturn(expectedValue); // perform test replayAll(); String actualValue = adapter.getValueAttribute(); verifyAll(); assertEquals(expectedValue, actualValue); }