Rename tests for clarity
@@ -62,32 +62,33 @@ public class EacGuiServiceTest {
}
@Test
- public void canDeliverCorrectGui(@Mocked EacGuiImpl input) {
+ public void canAssignGuiSuccessfully(@Mocked EacGuiImpl input) {
EacGuiService.setGuiImpl(input);
}
@Test(expectedExceptions = {IllegalStateException.class})
- public void canDeliverGuiMultipleTimes(@Mocked EacGuiImpl input1, @Mocked EacGuiImpl input2) throws IllegalStateException {
+ public void cannotDeliverGuiMultipleTimes(@Mocked EacGuiImpl input1, @Mocked EacGuiImpl input2) throws IllegalStateException {
EacGuiService.setGuiImpl(input1);
EacGuiService.setGuiImpl(input2);
}
@Test
- public void GivenNoGuiImplSetThenBindingWaitsForever(@Tested final EacGuiService sut, @Mocked final Intent input) {
+ public void givenGuiIsNotAssignedThenBindingWaitsForever(@Tested final EacGuiService sut, @Mocked final Intent input) {
Future<IBinder> future = callBindAsync(sut, input);
try {
//wait 1 seconds for the task to complete.
future.get(1000, TimeUnit.MILLISECONDS);
Assert.fail("The call to onBind(...) is supposed to wait forever and not terminate.");
- }
- catch (InterruptedException | ExecutionException | TimeoutException e) {
+ } catch (InterruptedException | ExecutionException | TimeoutException e) {
// Pass
}
}
@Test
- public void BindingWaitsForGuiAssignment(@Tested final EacGuiService sut, @Mocked final Intent inputIntent, @Mocked EacGuiImpl inputGui) throws InterruptedException, ExecutionException {
+ public void givenBindingStartsBeforeGuiAssignmentThenBindingWaitsForGuiAssignment(@Tested final EacGuiService sut,
+ @Mocked final Intent inputIntent,
+ @Mocked EacGuiImpl inputGui) throws InterruptedException, ExecutionException {
Future<IBinder> future = callBindAsync(sut, inputIntent);
TimeUnit.MILLISECONDS.sleep(2);
