Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

16 changes: 8 additions & 8 deletions Data-Integration.iml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="JUnit5.7.0">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use JUnit 5.7.0

<library name="JUnit5.8.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.7.0/junit-jupiter-5.7.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.8.1/junit-jupiter-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.7.0/junit-platform-commons-1.7.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.7.0/junit-jupiter-params-5.7.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.7.0/junit-jupiter-engine-5.7.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.7.0/junit-platform-engine-1.7.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.8.1/junit-platform-commons-1.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.8.1/junit-jupiter-params-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.8.1/junit-jupiter-engine-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.8.1/junit-platform-engine-1.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
Expand Down
Binary file not shown.
Binary file added out/production/Data-Integration/OrderBook/Fill.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added out/production/Data-Integration/OrderBook/Side.class
Binary file not shown.
Binary file not shown.
Binary file added out/production/Data-Integration/classpath.index
Binary file not shown.
Binary file added out/test/Data-Integration/classpath.index
Binary file not shown.
Binary file added out/test/Data-Integration/testOrderBook.class
Binary file not shown.
24 changes: 24 additions & 0 deletions src/test/testOrderBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import OrderBook.OrderBook;
import OrderBook.Side;
import org.junit.jupiter.api.Test;
import OrderBook.Fill;
import OrderBook.OrderType;

import static org.junit.jupiter.api.Assertions.*;

Expand Down Expand Up @@ -168,4 +170,26 @@ void placeTwoAsk() {
assertEquals(-1f, testSubject.bestBidPrice);
assertEquals(1.8f, testSubject.sittingVolume);
}

@Test
void checkBest(){
OrderBook testSubject = new OrderBook();

//Bids:
Order newBidOne = new Order(5.3f, 0.3f, Side.BID, 1677598183L);
testSubject.placeOrder(newBidOne);
Order newBidTwo = new Order(8.3f, 0.7f, Side.BID, 1977598183L);
testSubject.placeOrder(newBidTwo);
assertEquals(5.0, (double)Math.round(testSubject.bestBidPrice));

//Asks:
Order newAskOne = new Order(5.3f, 0.4f, Side.ASK, 1777598183L);
testSubject.placeOrder(newAskOne);
Order newAskTwo = new Order(8.3f, 0.2f, Side.ASK, 1877598183L);
testSubject.placeOrder(newAskTwo);
assertEquals(5.0, (double)Math.round(testSubject.bestAskPrice));

assertEquals(0.0,(double)Math.round(testSubject.sittingVolume));

}
}