Account improved

divided into interface and implementation
This commit is contained in:
7u83
2019-01-14 08:43:24 +01:00
parent 703fe209b2
commit f5552c7b5b
21 changed files with 533 additions and 413 deletions

View File

@ -66,7 +66,7 @@ public class AccountTest {
/* @Test
public void testGetAssets() {
System.out.println("getAssets");
Account instance = new Account();
AccountImpl instance = new AccountImpl();
Map<AbstractAsset, Double> expResult = null;
Map<AbstractAsset, Double> result = instance.getAssets();
assertEquals(expResult, result);
@ -75,12 +75,12 @@ public class AccountTest {
}
*/
/**
* Test of getOwner method, of class Account.
* Test of getOwner method, of class AccountImpl.
*/
@Test
public void testGetOwner() {
System.out.println("getOwner");
Account instance = new Account();
AccountImpl instance = new AccountImpl();
Trader expResult = null;
Trader result = instance.getOwner();
assertEquals(expResult, result);
@ -89,7 +89,7 @@ public class AccountTest {
}
/**
* Test of add method, of class Account.
* Test of add method, of class AccountImpl.
*/
@Test
public void testAdd() {
@ -100,7 +100,7 @@ public class AccountTest {
Double expResult = 123.0;
AssetPack pack = new AssetPack(c, expResult);
Account account = new Account();
AccountImpl account = new AccountImpl();
account.add(pack);
Double result;

View File

@ -89,11 +89,11 @@ public class ExchangeTest {
AssetPair ap = new AssetPair(world,"EUR","AAPL");
Exchange instance = new Exchange(null, (JSONObject) null);
Account expResult = null;
AccountImpl expResult = null;
Account result = instance.createAccount();
AccountImpl result = instance.createAccount();
// assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");

View File

@ -78,7 +78,7 @@ public class TradingAPITest {
@Test
public void testCreateOrder() {
System.out.println("createOrder");
Account account = null;
AccountImpl account = null;
Order.Type type = null;
double volume = 0.0;
double limit = 0.0;
@ -152,7 +152,7 @@ public class TradingAPITest {
public void addOrderBookListener(EventListener listener) {
}
public Order createOrder(Account account, Order.Type type, double volume, double limit) {
public Order createOrder(AccountImpl account, Order.Type type, double volume, double limit) {
return null;
}

View File

@ -110,7 +110,7 @@ public class TradingEngineTest {
// AbstractAsset currency = gdworld.createAsset(cfg);
Account account = new Account();
AccountImpl account = new AccountImpl();
Order.Type type = null;