Examples of OrderBookSnapshot


Examples of com.mcorrigal.matchingEngine.orderBook.OrderBookSnapshot

        assertThat(environment.getRealMatchingEngine().orderBookIsEmpty(), is(true));
    }

    @Then("^the order book shows:$")
    public void the_order_book_shows(List<SpecifiedOrderBookLevel> expectedOrderBookSnapshot) {
        OrderBookSnapshot orderBookSnapshot = environment.snapshotOrderBookNow();
        for (SpecifiedOrderBookLevel expectedBookLevel : expectedOrderBookSnapshot) {
            assertTrue(OrderBookUtils.orderListContainsOrder(orderBookSnapshot.getBidSideSnapshot(), expectedBookLevel.getBidSideAsShortHandDescription()));
            assertTrue(OrderBookUtils.orderListContainsOrder(orderBookSnapshot.getAskSideSnapshot(), expectedBookLevel.getAskSideAsShortHandDescription()));
        }
    }
View Full Code Here

Examples of com.mcorrigal.matchingEngine.orderBook.OrderBookSnapshot

  private OrderList publishedOrderBookSideFor(OrderBookSide orderBookSide) throws Exception {
    return orderBookSide.getOrderBookSideSnapshotFrom(lastPublishedOrderBookSnapshot());
  }

  private void assertOrderBookSideSizes(int expectedBids, int expectedAsks) {
    OrderBookSnapshot lastOrderBookSnapshot = lastPublishedOrderBookSnapshot();
    assertThat(lastOrderBookSnapshot.getBidSideSnapshot().size(), is(expectedBids));
    assertThat(lastOrderBookSnapshot.getAskSideSnapshot().size(), is(expectedAsks));
  }
View Full Code Here

Examples of com.mcorrigal.matchingEngine.orderBook.OrderBookSnapshot

  public void snapshotOrderBook() {
    BuyOrder buyA = OrderFactory.newLimitBuy("A", "25", "100");
    SellOrder sellA = OrderFactory.newLimitSell("A", "25", "100");
    orderBook.newBuyOrder(buyA);
    orderBook.newSellOrder(sellA);
    OrderBookSnapshot snapshot = orderBook.snapshot();
        assertTrue(snapshot.getBidSideSnapshot().getAll().contains(buyA));
        assertTrue(snapshot.getAskSideSnapshot().getAll().contains(sellA));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.