Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS682-HW1-OrderMatching
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rohit Prasad
CS682-HW1-OrderMatching
Commits
ea8d383e
Commit
ea8d383e
authored
Jan 20, 2018
by
Rohit Prasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for buySellOrderMatch() method
parent
bd2fed22
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
src/OrderMatchingTest.java
src/OrderMatchingTest.java
+29
-0
No files found.
src/OrderMatchingTest.java
0 → 100644
View file @
ea8d383e
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
import
org.junit.jupiter.api.Test
;
class
OrderMatchingTest
{
@Test
void
buySellOrderMatchTest
()
{
Customer
c1
=
new
Customer
(
"c1"
);
Customer
c2
=
new
Customer
(
"c2"
);
Stock
appleStock
=
new
Stock
(
"apple"
);
Stock
googleStock
=
new
Stock
(
"google"
);
OrderMatching
orderMatching
=
new
OrderMatching
();
BuyOrder
b1
=
new
BuyOrder
(
1
,
c1
,
googleStock
,
100
,
300
);
BuyOrder
b2
=
new
BuyOrder
(
2
,
c2
,
googleStock
,
300
,
200
);
BuyOrder
b3
=
new
BuyOrder
(
5
,
c1
,
googleStock
,
300
,
200
);
SellOrder
s1
=
new
SellOrder
(
3
,
c2
,
googleStock
,
200
,
200
);
SellOrder
s2
=
new
SellOrder
(
4
,
c2
,
appleStock
,
200
,
200
);
assertTrue
(
orderMatching
.
buySellOrderMatch
(
b1
,
s1
));
assertFalse
(
orderMatching
.
buySellOrderMatch
(
b1
,
s2
));
assertFalse
(
orderMatching
.
buySellOrderMatch
(
b1
,
s2
));
assertFalse
(
orderMatching
.
buySellOrderMatch
(
b2
,
s1
));
assertTrue
(
orderMatching
.
buySellOrderMatch
(
b3
,
s1
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment