Skip to content

Conversation

@mericeltao
Copy link
Collaborator

No description provided.

@mericeltao mericeltao linked an issue Mar 5, 2023 that may be closed by this pull request
@DanielMistrik DanielMistrik self-requested a review March 5, 2023 18:53
Copy link
Collaborator

@DanielMistrik DanielMistrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the comments made. Also make sure that the test cases all pass for you and if not address the issues causing the test cases to fail.

Order newAsk = new Order(10.3f, 1.2f, Side.ASK, 1677538239L);
testSubject.placeOrder(newAsk);
// Checking Operation
assertEquals(1, testSubject.asks.size());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this throw? With three sitting Ask order we would expect the number of ask orders to be 3 not 1

assertEquals(0, testSubject.bids.size());
assertEquals(3.2f, testSubject.asks.getFirst().price);
assertEquals(0.5f, testSubject.asks.getFirst().size);
assertEquals(1677539233L, testSubject.asks.getFirst().createdTs);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best ask price (the lower the better) would be 3.2 now.

assertEquals(10.3f, testSubject.asks.getFirst().price);
assertEquals(1.2f, testSubject.asks.getFirst().size);
assertEquals(1677538239L, testSubject.asks.getFirst().createdTs);
assertEquals(10.3f, testSubject.bestAskPrice);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at the 2nd comment above.

Order newBid = new Order(5.3f, 0.3f, Side.BID, 1677598183L);
testSubject.placeOrder(newBid);
//Checking Operation
assertEquals(2, testSubject.asks.size());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ask size() would be 1, not 2.

@mericeltao mericeltao closed this Mar 5, 2023
@mericeltao mericeltao reopened this Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task 1 - Implement testOrderBook - Mericel

3 participants