-
Notifications
You must be signed in to change notification settings - Fork 2
added new test cases #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
DanielMistrik
left a comment
There was a problem hiding this 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.
src/test/testOrderBook.java
Outdated
| Order newAsk = new Order(10.3f, 1.2f, Side.ASK, 1677538239L); | ||
| testSubject.placeOrder(newAsk); | ||
| // Checking Operation | ||
| assertEquals(1, testSubject.asks.size()); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
src/test/testOrderBook.java
Outdated
| 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); |
There was a problem hiding this comment.
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.
src/test/testOrderBook.java
Outdated
| Order newBid = new Order(5.3f, 0.3f, Side.BID, 1677598183L); | ||
| testSubject.placeOrder(newBid); | ||
| //Checking Operation | ||
| assertEquals(2, testSubject.asks.size()); |
There was a problem hiding this comment.
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.
No description provided.