示例#1
0
  @Test
  public void addTwoGroupsToBibEntryChangesGroupsField() {
    group.add(entry);
    group2.add(entry);

    assertEquals(
        Optional.of("myExplicitGroup, myExplicitGroup2"), entry.getField(FieldName.GROUPS));
  }
示例#2
0
  @Test
  public void addDuplicateGroupDoesNotChangeGroupsField() throws Exception {
    entry.setField(FieldName.GROUPS, "myExplicitGroup");
    group.add(entry);

    assertEquals(Optional.of("myExplicitGroup"), entry.getField(FieldName.GROUPS));
  }
示例#3
0
  @Test
  public void addSingleGroupToNonemptyBibEntryAppendsToGroupsField() {
    entry.setField(FieldName.GROUPS, "some thing");
    group.add(entry);

    assertEquals(Optional.of("some thing, myExplicitGroup"), entry.getField(FieldName.GROUPS));
  }
示例#4
0
  @Test
  public void addSingleGroupToEmptyBibEntryChangesGroupsField() {
    group.add(entry);

    assertEquals(Optional.of("myExplicitGroup"), entry.getField(FieldName.GROUPS));
  }