コード例 #1
0
  @Test
  public void canReturnWalletAccountInOpenWallet() {
    // Arrange:
    final WalletAccount account = new WalletAccount();
    final TestContext context = new TestContext();
    context.originalWallet.addOtherAccount(account);

    // Act:
    context.walletServices.open(context.pair);
    final WalletAccount resultAccount =
        context.walletServices.tryFindOpenAccount(account.getAddress());

    // Assert:
    Assert.assertThat(resultAccount, IsEqual.equalTo(account));
  }
コード例 #2
0
  @Test
  public void cannotReturnWalletAccountInClosedWallet() {
    // Arrange:
    final WalletAccount account = new WalletAccount();
    final TestContext context = new TestContext();
    context.originalWallet.addOtherAccount(account);

    // Act:
    context.walletServices.open(context.pair);
    context.walletServices.close(context.pair.getName());
    final WalletAccount resultAccount =
        context.walletServices.tryFindOpenAccount(account.getAddress());

    // Assert:
    Assert.assertThat(resultAccount, IsNull.nullValue());
  }