Amend the test method names to include a when and remove unused throws

This commit is contained in:
Alex Theedom 2016-08-22 19:31:23 +01:00
parent 4f7cb84630
commit dfd8b0c4cc
1 changed files with 2 additions and 3 deletions

View File

@ -9,10 +9,9 @@ import java.util.Random;
public class RandomListElementTest {
@Test
public void givenList_shouldReturnARandomElement1() throws Exception {
public void givenList_whenRandomNumberChosen_shouldReturnARandomElement() {
List<Integer> givenList = Arrays.asList(1, 2, 3);
Random rand = new Random();
Integer result = givenList.get(rand.nextInt(givenList.size()));
givenList.get(rand.nextInt(givenList.size()));
}
}