Skip to content

Commit

Permalink
Sort test members.
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Sep 28, 2021
1 parent 3664d88 commit 78c4b0f
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -27,28 +27,28 @@
public class SortedPropertiesTest {

@Test
public void testKeys() {
public void testEntrySet() {
final SortedProperties sortedProperties = new SortedProperties();
for (char ch = 'Z'; ch >= 'A'; ch--) {
sortedProperties.put(String.valueOf(ch), "Value" + ch);
}
final Enumeration<Object> keys = sortedProperties.keys();
final Iterator<Map.Entry<Object, Object>> entries = sortedProperties.entrySet().iterator();
for (char ch = 'A'; ch <= 'Z'; ch++) {
Assert.assertEquals(String.valueOf(ch), keys.nextElement());
final Map.Entry<Object, Object> entry = entries.next();
Assert.assertEquals(String.valueOf(ch), entry.getKey());
Assert.assertEquals("Value" + ch, entry.getValue());
}
}

@Test
public void testEntrySet() {
public void testKeys() {
final SortedProperties sortedProperties = new SortedProperties();
for (char ch = 'Z'; ch >= 'A'; ch--) {
sortedProperties.put(String.valueOf(ch), "Value" + ch);
}
final Iterator<Map.Entry<Object, Object>> entries = sortedProperties.entrySet().iterator();
final Enumeration<Object> keys = sortedProperties.keys();
for (char ch = 'A'; ch <= 'Z'; ch++) {
final Map.Entry<Object, Object> entry = entries.next();
Assert.assertEquals(String.valueOf(ch), entry.getKey());
Assert.assertEquals("Value" + ch, entry.getValue());
Assert.assertEquals(String.valueOf(ch), keys.nextElement());
}
}
}

0 comments on commit 78c4b0f

Please sign in to comment.