@Test public void addTwoGroupsToBibEntryChangesGroupsField() { group.add(entry); group2.add(entry); assertEquals( Optional.of("myExplicitGroup, myExplicitGroup2"), entry.getField(FieldName.GROUPS)); }
@Test public void addDuplicateGroupDoesNotChangeGroupsField() throws Exception { entry.setField(FieldName.GROUPS, "myExplicitGroup"); group.add(entry); assertEquals(Optional.of("myExplicitGroup"), entry.getField(FieldName.GROUPS)); }
@Test public void addSingleGroupToNonemptyBibEntryAppendsToGroupsField() { entry.setField(FieldName.GROUPS, "some thing"); group.add(entry); assertEquals(Optional.of("some thing, myExplicitGroup"), entry.getField(FieldName.GROUPS)); }
@Test public void addSingleGroupToEmptyBibEntryChangesGroupsField() { group.add(entry); assertEquals(Optional.of("myExplicitGroup"), entry.getField(FieldName.GROUPS)); }