예제 #1
0
  @Test
  public void shouldSplitPerSinglePosition() {
    Splitter splitter = SplitterBuilder.from("position");

    Split split = splitter.split(positions);

    assertThat(split.size(), is(4));
  }
예제 #2
0
  @Test
  public void shouldSplitByOwner() {
    Splitter splitter = SplitterBuilder.from("owner");

    Split split = splitter.split(positions);
    assertThat(split.size(), is(3));
    hasGroup(split, "accountOwner");
    hasGroup(split, "bondOwner");
    hasGroup(split, "equityOwner");
  }
예제 #3
0
  @Test
  public void shouldSplitPerCurrency() {
    Splitter splitter = SplitterBuilder.from("currency");

    Split split = splitter.split(positions);

    assertThat(split.size(), is(2));
    hasGroup(split, "CHF");
    hasGroup(split, "USD");
    assertThat(split.positions("CHF").size(), is(3));
    assertThat(split.positions("USD").size(), is(1));
  }
예제 #4
0
  @Test
  public void shouldCreateASplit() {
    Split split = new Split();
    split.add("CHF", positions);
    split.add("USD", new Positions());

    assertThat(split.size(), is(2));
    hasGroup(split, "CHF");
    hasGroup(split, "USD");
    assertThat(split.positions("CHF").size(), is(4));
    assertThat(split.positions("USD").size(), is(0));
  }
예제 #5
0
  @Test
  @Ignore
  public void shouldSplitPerPositionType() {
    Splitter splitter = SplitterBuilder.from("type");

    Split split = splitter.split(positions);

    assertThat(split.size(), is(3));

    hasGroup(split, "Account");
    hasGroup(split, "Bond");
    hasGroup(split, "Equity");
  }
예제 #6
0
 private void hasGroup(Split split, String string) {
   assertThat(split.groups(), hasItem((Object) string));
 }