diff --git a/Untitled Diagram.xml b/Untitled Diagram.xml
new file mode 100644
index 0000000..36aa9f4
--- /dev/null
+++ b/Untitled Diagram.xml
@@ -0,0 +1 @@
+3Vvbkps4EP0aP84UQuDLYzKX7MtWpWq2ajePDMiGGoxYIY/tfP1KIDCoZUe2uaR2XmJaQqCjo+7TajLDT9vDNxbk8Z80IunMdaLDDD/PXBd52BP/SMuxsnirVWXYsCRSnU6Gt+QnUUZHWXdJRIpOR05pypO8awxplpGQd2wBY3Tf7bamafepebAhwPAWBim0/p1EPFZWNF+dGv4gySZWj16686rhPQg/NozuMvW8mYvX5V/VvA3qsdREiziI6L5lwi8z/MQo5dWv7eGJpBLbGrbqvtczrc17M5Jxmxvc6obPIN2pqf8VMxJEwqbGKvixRqXYJ9s0yMTV132ccPKWB6Fs2gsSwAer+z8J4+TQMqkX+UbolnB2FF1Ua43JsXu5Py2Au1S2uIW9v1DGQC36phn5NHHxQ83djIMPcACzFzcI+snJi0XLpbHgAeNvPODSuE7S9ImmlJW9sVP+yc6c0Q/SalmvVQuEzL0WMuR0MfMgZtgAGe4BsbkFYpHYVOqSpO90/3IyfC0NoiGmLPlJMx6IB32VM0/ENvySJptMNL5TzulW9s6iL3JfCxvNSVZZlN9YmlB+fVUoi36viZzFMxJX5dYkcgrOWfgLumMh6fBCLPSGqF6LyiQnd88SmbBXg3yniXil0wjI74yAkDZE9XbqLm0FmxeyWtQFWNQkEqulL2wPzJ075jnt2+7WtNt7oO4SzHJXECYHDXlCsxGma3Jug013ZbFTwfYaakMt4IZaWm4oRtKAJ5/dEH0PMDXgLWRyWvBSV2y3gYjhwzMB1y5mDCYgBCY8IRWWkAr1xCfgAlRCPcSzi9DBgHYHmDVyt0SqNvUcA/UaozXqZwKZ7gVXGqerCYFABgYC0UMf6ExEFIgHx1a3XHYozr8w1t7X74hp8aMa8NZoiwHlGvENyTew+MaaTBlVfSOIBNx8w8tvfC1oGg1HVN/IG8JdTSu/scGrYUOM8C3d2qG7Khqx7d2W35Xflr7mBn+AYBZqKb+vZq6Wa48qvxFMHcOYhB8zeVAjZfhMJpcYSfpkZH+SY8UISIyqzBHMt+AuHkaPmTabIdmt12oCQQaztEaVO//uyG6MfTGuOp8uUTOxYW5gw2SpmgszF8UBh2xzfgRAsZhu33cFVAbyMDYcXBkgX3crkEgmOXXpdMgaK5jKHAn0ndfLg0DJgpSs+UBq4ZDwfyRFH3119aMk7CUyyzaBUHXbwq+vf5yGkZffCUsEkoRZb4Cm8NDaAO6V2uNBjdFz4oR0d9NTvtPkUfVzlv0mPIaMJ6PDE5PTfEINa+JRnQKMzSNtfbHjW/HolqW2SVAmDWY1fBMEM4tqU53kpkmZ8lfA1LXI+cXwxajIieU5Nn5enYfnilimHYMgd/EIo5lviGbI7wGs/2GhyeQlTOL7ymijL5Seqf7aQegnXkjXI/05iPpJrXWNkiIPeBi38r9G8jeWPWUfZbGGq7Oy/pMA5E2YBWCodEOWlGRtoVAQc6mqdhsZ5eaTQnFrReY697wPKad7NuKtDNmz6Ui5F6Sgzr0UYjLa8qSXN7ADJGYUFHF5YfjCwhRvDLUNPFm8wRax2MiUs1BpOZWy388n1+vyCa8MgQayyeshzng2tbGr48wpNYF5yUDFIQMda1/boaNnScexqkP6YfpScxG2xSE9WcL6QL0lS5rvc/pNluCmbapD9RKPVh3yl11MR60OYZg15oyGpChMQuGXcsC7dvJa0uQ5Y6oBmw/TJipLdw5e3BsPXjzomawPWcbyTA+aKvb0D7BsXdMD0usuejWqJ9/0gLTnKB71Vrm2KVy0aGmjvW6PeAYO1T7j9+WQu3rUVIsti3R/BEfqMUuDVRi40KAyL1PmG+vy97trPQv2HRishirL4+lKOAqnjuwzVM/xdCUcmPCPhQ2C2Ji+lxqtvCUuT5/4V7vy9P8o8Mt/
\ No newline at end of file
diff --git a/atm_uml.xml b/atm_uml.xml
new file mode 100644
index 0000000..9caa683
--- /dev/null
+++ b/atm_uml.xml
@@ -0,0 +1 @@
+7V1rc+I4s/411GY+hPKN20cgk3dTJ3OpkN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
index 9901415..b450953 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,6 +7,14 @@
io.zipcoder
project-2-atm
1.0-SNAPSHOT
+
+
+
+ junit
+ junit
+ 4.12
+
+
\ No newline at end of file
diff --git a/src/main/java/io/zipcoder/macrolabs/atm/Account.java b/src/main/java/io/zipcoder/macrolabs/atm/Account.java
new file mode 100644
index 0000000..20e0169
--- /dev/null
+++ b/src/main/java/io/zipcoder/macrolabs/atm/Account.java
@@ -0,0 +1,75 @@
+package io.zipcoder.macrolabs.atm;
+
+import java.util.ArrayList;
+
+public class Account {
+ private String accountName="";
+ private final int ownedByUserID;
+ private final int accountNumber;
+ private static int nextAccountNumber;
+ protected double balance=0;
+ private ArrayList transactionHistory=new ArrayList<>();
+
+ static{
+ nextAccountNumber=1;
+ }
+
+ //Object initialization block
+ {
+ accountNumber=nextAccountNumber;
+ nextAccountNumber++;
+ }
+
+
+
+ public Account(int passedOwnerUserID)
+ {
+ ownedByUserID=passedOwnerUserID;
+ }
+
+ public Account(int passedOwnerUserID, String passedAccountName){
+ accountName=passedAccountName;
+ ownedByUserID=passedOwnerUserID;
+ }
+
+ protected String transactionBuilder(String descriptionOfChange, double amount){
+ String lineItem="";
+ lineItem+=descriptionOfChange + amount;
+ return lineItem;
+ }
+
+ public void changeBalance(double amount){
+ balance+=amount;
+ changeTransactionHistory(transactionBuilder("Account, overload changeBalance ", amount) );
+
+ }
+
+ public double getBalance(){
+ return (balance);
+ }
+
+ public ArrayList getTransactionHistory() {
+ return transactionHistory;
+ }
+
+ protected void changeTransactionHistory(String lineItem){
+ transactionHistory.add(lineItem);
+ }
+
+ public String getAccountName(){
+ return accountName;
+ }
+
+ public int getAccountNumber() {
+ return accountNumber;
+ }
+
+ public void setAccountName(String passedAccountName) {
+ accountName = passedAccountName;
+ }
+
+ public int getOwnerID(){
+ return ownedByUserID;
+ }
+
+}
diff --git a/src/main/java/io/zipcoder/macrolabs/atm/AccountFactory.java b/src/main/java/io/zipcoder/macrolabs/atm/AccountFactory.java
new file mode 100644
index 0000000..77e9413
--- /dev/null
+++ b/src/main/java/io/zipcoder/macrolabs/atm/AccountFactory.java
@@ -0,0 +1,39 @@
+package io.zipcoder.macrolabs.atm;
+
+public class AccountFactory {
+
+ private AccountFactory(){}
+
+ public static InvestmentAccount createInvestment(int passedUserID){
+ return (createInvestment(passedUserID, "Investment Account"));
+ }
+
+ public static InvestmentAccount createInvestment(int passedUserID,
+ String passedAccountName){
+ return (createInvestment(passedUserID, passedAccountName, 7.95));
+
+ }
+
+ public static InvestmentAccount createInvestment(int passedUserID,
+ String passedAccountName,
+ double passedCommissionRate){
+ return (new InvestmentAccount(passedUserID, passedAccountName, passedCommissionRate));
+ }
+
+ public static SavingAccount createSaving(int passedUserID){
+ return (createSaving(passedUserID, "Saving Account"));
+ }
+
+ public static SavingAccount createSaving(int passedUserID,
+ String passedAccountName){
+ return (createSaving(passedUserID, passedAccountName, 0.01));
+
+ }
+
+ public static SavingAccount createSaving(int passedUserID,
+ String passedAccountName,
+ double passedInterestRate){
+ return (new SavingAccount(passedUserID, passedAccountName, passedInterestRate));
+ }
+
+}
diff --git a/src/main/java/io/zipcoder/macrolabs/atm/InvestmentAccount.java b/src/main/java/io/zipcoder/macrolabs/atm/InvestmentAccount.java
new file mode 100644
index 0000000..09ebf47
--- /dev/null
+++ b/src/main/java/io/zipcoder/macrolabs/atm/InvestmentAccount.java
@@ -0,0 +1,180 @@
+package io.zipcoder.macrolabs.atm;
+
+import java.util.ArrayList;
+
+public class InvestmentAccount extends Account{
+
+ private double securitiesTotalValue;
+ private ArrayList ownedSecurities=new ArrayList<>();
+ private double commissionRate=7.95;
+ private double accountTotalValue;
+
+ public InvestmentAccount(int passedOwnerUserID) {
+ super(passedOwnerUserID, "Investment Account");
+ }
+
+ public InvestmentAccount(int passedOwnerUserID, String passedAccountName){
+ super(passedOwnerUserID, passedAccountName);
+ }
+
+ public InvestmentAccount(int passedOwnerUserID, String passedAccountName,
+ double passedCommissionRate){
+ super(passedOwnerUserID, passedAccountName);
+ commissionRate=passedCommissionRate;
+ }
+
+ public void changeBalance(String descriptionOfChange, double amount) {
+ balance+=amount;
+ this.setAccountTotalValue(this.getBalance()+this.getSecuritiesTotalValue());
+ changeTransactionHistory(transactionBuilder(descriptionOfChange, amount));
+
+ }
+
+ public ArrayList getSecurityList(){
+ return (ownedSecurities);
+ }
+
+ public boolean tradeSecurity (String passedName, double sharesToTrade){
+ boolean tradeSuccess=false;
+ if (sharesToTrade>0)
+ {
+ tradeSuccess=buySecurity(passedName, sharesToTrade);
+ }
+ else if (sharesToTrade<0)
+ {
+ tradeSuccess=sellSecurity(passedName, sharesToTrade);
+ }
+ accountTotalValue=getBalance()+calculateSecuritiesTotalValue();
+ return tradeSuccess;
+ }
+
+ private boolean sellSecurity(String passedName, double sharesToTrade){
+ if (isSecurityAvailableToSell(passedName, sharesToTrade))
+ {
+ for (int i=0; ithis.getBalance() ) {
+ return false;
+ }
+ return true;
+ }
+
+ private double calculateSecuritiesTotalValue(){
+ double calculateSecuritiesValue=0.0;
+ for (Security s : ownedSecurities)
+ {
+ calculateSecuritiesValue += (s.getValue() * s.getNumberOwned());
+ }
+ setSecuritiesTotalValue(calculateSecuritiesValue);
+ setAccountTotalValue(getBalance()+calculateSecuritiesValue);
+ return calculateSecuritiesValue;
+ }
+
+ public double getCommissionRate(){
+ return commissionRate;
+ }
+
+ public void setCommissionRate(double passedCommissionRate){
+ commissionRate=passedCommissionRate;
+ }
+
+ private void setSecuritiesTotalValue(double passedTotal){
+ securitiesTotalValue=passedTotal;
+ }
+
+ private void setAccountTotalValue(double passedTotal){
+ accountTotalValue=passedTotal;
+ }
+
+ public double getAccountTotalValue(){
+ return accountTotalValue;
+ }
+
+ public double getSecuritiesTotalValue(){
+ return securitiesTotalValue;
+ }
+
+
+}
diff --git a/src/main/java/Main.java b/src/main/java/io/zipcoder/macrolabs/atm/Main.java
similarity index 77%
rename from src/main/java/Main.java
rename to src/main/java/io/zipcoder/macrolabs/atm/Main.java
index 05e41a9..d9187a8 100644
--- a/src/main/java/Main.java
+++ b/src/main/java/io/zipcoder/macrolabs/atm/Main.java
@@ -1,6 +1,9 @@
/**
* Created by iyasuwatts on 10/17/17.
*/
+package io.zipcoder.macrolabs.atm;
+
+
public class Main {
public static void main(String[] args){
diff --git a/src/main/java/io/zipcoder/macrolabs/atm/SavingAccount.java b/src/main/java/io/zipcoder/macrolabs/atm/SavingAccount.java
new file mode 100644
index 0000000..e3239cd
--- /dev/null
+++ b/src/main/java/io/zipcoder/macrolabs/atm/SavingAccount.java
@@ -0,0 +1,24 @@
+package io.zipcoder.macrolabs.atm;
+
+public class SavingAccount extends Account{
+
+ private double interestRate;
+
+ public SavingAccount(int passedOwnerUserID) {
+ this(passedOwnerUserID, "Saving Account");
+ }
+
+ public SavingAccount(int passedOwnerUserID, String passedAccountName){
+ this(passedOwnerUserID, passedAccountName, 0.01);
+ }
+
+ public SavingAccount(int passedOwnerUserID, String passedAccountName,
+ double passedInterestRate){
+ super(passedOwnerUserID, passedAccountName);
+ interestRate=passedInterestRate;
+ }
+
+ public double getInterestRate(){
+ return interestRate;
+ }
+}
diff --git a/src/main/java/io/zipcoder/macrolabs/atm/Security.java b/src/main/java/io/zipcoder/macrolabs/atm/Security.java
new file mode 100644
index 0000000..08702e6
--- /dev/null
+++ b/src/main/java/io/zipcoder/macrolabs/atm/Security.java
@@ -0,0 +1,40 @@
+package io.zipcoder.macrolabs.atm;
+
+import java.util.Random;
+
+public class Security
+{
+ private final String name;
+ private double numberOwned=0;
+ private double value=0;
+
+ public Security(String passedName, double passedNumberOwned, double passedValue){
+ name=passedName;
+ numberOwned=passedNumberOwned;
+ value=passedValue;
+ }
+
+ public Security(String passedName, double passedNumberOwned){
+ Random randomizer = new Random();
+ name = passedName;
+ numberOwned = passedNumberOwned;
+ value = Math.abs( (randomizer.nextDouble()*randomizer.nextInt(50)) );
+ }
+
+ public String getName(){
+ return name;
+ }
+
+ public double getNumberOwned(){
+ return numberOwned;
+ }
+
+ public void changeNumberOwned(double numberDifference){
+ numberOwned+=numberDifference;
+ }
+
+ public double getValue(){
+ return value;
+ }
+
+}
diff --git a/src/main/java/io/zipcoder/macrolabs/atm/SecurityFactory.java b/src/main/java/io/zipcoder/macrolabs/atm/SecurityFactory.java
new file mode 100644
index 0000000..c95549b
--- /dev/null
+++ b/src/main/java/io/zipcoder/macrolabs/atm/SecurityFactory.java
@@ -0,0 +1,30 @@
+package io.zipcoder.macrolabs.atm;
+
+import java.util.Random;
+
+public class SecurityFactory {
+ private SecurityFactory(){} //cannot instantiate. Must use class via static methods
+
+ public static Security createRandomSecurity(){
+ Random randomizer = new Random();
+ String name ="";
+ for (int i=0; i<3; i++)
+ {
+ name = name + (char) (randomizer.nextInt(26) + 65);
+ }
+
+ double numberOwned = Math.abs( (randomizer.nextDouble()*randomizer.nextInt(100)) );
+ double value = Math.abs( (randomizer.nextDouble()*randomizer.nextInt(50)) );
+
+ return (new Security(name, numberOwned, value));
+ }
+
+ public static Security createSecurity(String passedName){
+ return (new Security(passedName, 0));
+ }
+
+ public static Security createSecurity(String passedName, double passedSharesOwned){
+ return (new Security(passedName, passedSharesOwned));
+ }
+
+}
diff --git a/src/test/java/io/zipcoder/macrolabs/atm/mainTest.java b/src/test/java/io/zipcoder/macrolabs/atm/mainTest.java
new file mode 100644
index 0000000..6007118
--- /dev/null
+++ b/src/test/java/io/zipcoder/macrolabs/atm/mainTest.java
@@ -0,0 +1,398 @@
+package io.zipcoder.macrolabs.atm; /**
+ * Created by Timothy Rager on 10/24/17.
+ */
+
+import org.junit.Assert;
+import org.junit.Test;
+import java.util.ArrayList;
+
+public class mainTest {
+
+ public final double allowedDeltaShares = 0.0001; //Securities to three decimal places-->Accuracy, not formatting
+ public final double allowedDeltaDollars = 0.001; //Dollars to two decimal places -->Accuracy, not formatting
+
+//SECURITY CLASS TESTS
+ @Test
+ public void testSecurityGetName(){
+ String expected="XKCD";
+ Security security = new Security(expected, 10.02, 25.12);
+ String actual = security.getName();
+
+ Assert.assertEquals("The strings do not match", expected, actual);
+ }
+ @Test
+ public void testSecurityGetNumberOwned(){
+ double expected=10.030;
+ Security security = new Security("XKCD", expected, 25.12);
+ double actual = security.getNumberOwned();
+
+ Assert.assertEquals(expected, actual, allowedDeltaShares);//Seeking reasonable precision within
+ // three decimal places
+ }
+
+ @Test
+ public void testSecurityChangeNumberOwned_PassNegative(){
+ double expected=20.026;
+ double changedBy=-0.004;
+ Security security=new Security("XKCD", 20.03,10);
+ security.changeNumberOwned(changedBy);
+ double actual=security.getNumberOwned();
+ Assert.assertEquals(expected, actual, allowedDeltaShares);
+ }
+
+ @Test
+ public void testSecurityChangeNumberOwned_PassPositive(){
+ double expected=20.034;
+ double changedBy=0.004;
+ Security security=new Security("XKCD", 20.03,10);
+ security.changeNumberOwned(changedBy);
+ double actual=security.getNumberOwned();
+ Assert.assertEquals(expected, actual, allowedDeltaShares);
+ }
+
+ @Test
+ public void testSecurityGetValue(){
+ double expected=25.12;
+ Security security = new Security("XKCD", 200, 25.12);
+ double actual = security.getValue();
+
+ Assert.assertEquals(expected, actual, allowedDeltaDollars);
+ }
+
+//SECURITYFACTORY TESTS
+
+ @Test
+ public void testSecurityFactoryCreateRandomSecurity(){
+ Security security=SecurityFactory.createRandomSecurity();
+ //We'll check the fields of security and if they are not of the correct type / format
+ // then set to false (ie, name should be three characters long, value and numberOwned
+ //should be positive
+
+ Assert.assertTrue(security.getValue()>=0);
+ Assert.assertTrue(security.getNumberOwned()>=0);
+ Assert.assertTrue(security.getName().length()==3);
+
+ }
+
+ @Test
+ public void testSecurityFactoryCreateSecurity_PassedString(){
+ Security security=SecurityFactory.createSecurity("XKCD");
+
+ Assert.assertTrue(security.getValue()>=0);
+ Assert.assertTrue(security.getNumberOwned()>=0);
+ Assert.assertTrue(security.getName().length()==4);
+ }
+
+ @Test
+ public void testSecurityFactoryCreateSecurity_PassedStringAndSharesOwned(){
+ Security security=SecurityFactory.createSecurity("XKCD", 25);
+
+ Assert.assertTrue(security.getValue()>=0);
+ Assert.assertTrue(security.getNumberOwned()>=0);
+ Assert.assertTrue(security.getName().length()==4);
+ }
+
+//ACCOUNT TESTS
+ @Test
+ public void testAccountGetAccountNumber()
+ {
+ Account account=new Account(1);
+ Account secondAccount=new Account(1);
+ int expected=secondAccount.getAccountNumber();
+
+ for (int i=1; i<=10; i++)
+ {
+ account=new Account(i);
+ expected++;
+ }
+ for (int i=1; i<=10; i++)
+ {
+ secondAccount=new Account(i);
+ expected++;
+ }
+ int actual = secondAccount.getAccountNumber();
+
+ Assert.assertEquals("Account numbers don't match", expected, actual);
+ }
+ @Test
+ public void testAccountConstructors(){
+ Account[] twoAccounts = {new Account(1),
+ new Account(2,"Checksorg")};
+ Assert.assertTrue(twoAccounts[0].getAccountName().isEmpty());
+ Assert.assertTrue(!(twoAccounts[1].getAccountName().isEmpty()));
+ }
+
+ @Test
+ public void testAccountChangeBalanceAndGetBalance(){
+ //double expected=10.5;
+ double expected=-10.5;
+ Account account = new Account(1);
+ account.changeBalance(expected);
+ double actual=account.getBalance();
+
+ Assert.assertEquals(expected, actual, allowedDeltaDollars);
+ }
+
+ @Test
+ public void testAccountChangeTransactionHistoryAndGetTransactionHistory() {
+ Account account=new Account(1);
+ ArrayList expected=new ArrayList<>();
+
+ expected.add("Account, overload changeBalance 1.1");
+ expected.add("Account, overload changeBalance -2.2");//expected contains {1.1, -2.2}
+
+ account.changeBalance(1.1);
+ account.changeBalance(-2.2);
+
+ ArrayList actual = account.getTransactionHistory();
+
+ boolean sameElementsInAL = false;
+
+ if (actual.get(0).equals(expected.get(0)) && actual.get(1).equals(expected.get(1)))
+ sameElementsInAL = true;
+ Assert.assertTrue("The elements in the ALs were not the same", sameElementsInAL);
+ }
+
+ @Test
+ public void testAccountSetAccountNameAndGetAccountName(){
+ Account account = new Account (1,"For College");
+ String expected = "For Boat";
+ //account.setAccountName("For Beer");
+ account.setAccountName(expected);
+ String actual = account.getAccountName();
+
+ Assert.assertEquals("the strings do not match", expected, actual);
+ }
+
+ @Test
+ public void testAccountGetOwnerID(){
+ Account account = new Account(1);
+ //int expected = 2;
+ int expected = 1;
+ int actual = account.getOwnerID();
+
+ Assert.assertTrue("The ownerIDs do not match",expected==actual);
+ }
+
+//INVESTMENTACCOUNT TESTS
+ @Test
+ public void testInvestmentAccountConstructorPassedIdOnly(){
+ InvestmentAccount ia = new InvestmentAccount(1);
+ String expected = "Investment Account";
+ String actual = ia.getAccountName();
+ Assert.assertEquals("Constructor sans nickname default not working", expected, actual);
+ }
+
+ @Test
+ public void testInvestmentAccountConstructorAndGetCommissionRate(){
+ InvestmentAccount ia = new InvestmentAccount(1,
+ "Retirement",
+ 6.95);
+ double expected = 6.95;
+ double actual = ia.getCommissionRate();
+ Assert.assertEquals(expected, actual, allowedDeltaDollars);
+ }
+
+ @Test
+ public void testInvestmentAccountSetCommissionRate(){
+ InvestmentAccount ia = new InvestmentAccount(1,
+ "Retirement",
+ 6.95);
+ double expected = 9.95;
+ ia.setCommissionRate(expected);
+ double actual = ia.getCommissionRate();
+ Assert.assertEquals(expected, actual, allowedDeltaDollars);
+ }
+
+ @Test
+ public void testInvestmentAccountGetSecurityList(){
+ InvestmentAccount ia = new InvestmentAccount(1, "Retirement");
+ Assert.assertTrue("Null", ia.getSecurityList()!=null);
+ }
+
+ //tradeSecurity(String,double)
+ //This public method implicitly runs several private methods.
+ // If passed positive shares, we buy. If negative, we sell. If 0, return false
+ //Tests buySecurity -> generateSecurityToBuy ->isCashAvailableToBuy -> calculateSecuritiesTotalValue
+ // returns true if everything worked as intended, false otherwise.
+ //Tests sellSecurity -> isSecurityAvailableToSell -> calculateSecuritiesTotalValue
+ // returns true if everything worked as intended, false otherwise.
+ //
+ //Note that as a consequence of calling calculateSecuritiesTotalValue() we also
+ //call the setters for securitiesTotalValue and totalAccountValue.
+
+
+ @Test
+ public void testInvestmentAccountTradeSecurityPassed_0(){
+ InvestmentAccount ia = new InvestmentAccount(1,"R");
+ boolean expected=false;
+ boolean actual=ia.tradeSecurity("XKCD",0);
+
+ Assert.assertTrue("Shouldn't be able to trade on 0 shares", expected==actual);
+ }
+
+ @Test
+ public void testInvestmentAccountTradeSecurityPassed_PositiveCreatesSecurity(){
+ InvestmentAccount ia = new InvestmentAccount(1,"R");
+ ia.changeBalance(10000000);//Seed the account with cash
+ boolean expected=true;
+ boolean actual=ia.tradeSecurity("XKCD",1);
+
+ Assert.assertTrue("Failed to transact", expected==actual);
+ }
+
+ @Test
+ public void testInvestmentAccountTradeSecurityPassed_PositiveSecurityPreexisting(){
+ InvestmentAccount ia = new InvestmentAccount(1,"R");
+ ia.changeBalance(10000000);//Seed the account with cash
+ boolean expected=true;
+ boolean actual=ia.tradeSecurity("XKCD",1);
+
+ actual=ia.tradeSecurity("XKCD", 10);//Buy more of the existing
+
+ Assert.assertTrue("Failed to transact", expected==actual);
+ }
+
+ @Test
+ public void testInvestmentAccountChangeBalanceWithTransactionBuilder(){
+ InvestmentAccount ia = new InvestmentAccount(1,"R");
+ ia.changeBalance("Testing change balance with transactionBuilder : ", 10000000);//Seed the account with cash
+ String expected = "Testing change balance with transactionBuilder : 1.0E7";
+ String actual = ia.getTransactionHistory().get(0);
+
+ Assert.assertEquals("Strings don't match", expected, actual);
+ }
+
+ @Test
+ public void testInvestmentAccountTradeSecurityPassed_Negative(){
+ //Must create a security in order to sell it, so we repeat the
+ //code from "."_Positive(), above
+ InvestmentAccount ia = new InvestmentAccount(1,"R");
+ ia.changeBalance(10_000_000);//Seed the account with cash
+ boolean expected=true;
+ boolean actual=ia.tradeSecurity("XKCD",1);//Placeholder to generate security to sell
+ //We can reasonably expect that if, after running the sell, the value of the
+ //account's cash position is 10_000_000 - commission*2 then things ran smoothly.
+ //Another possibility for testing these methods?
+ //System.out.println("$10,000,000 - "+ia.getCommissionRate()*2+" = "+
+ // (10_000_000-(ia.getCommissionRate()*2)));
+ actual=ia.tradeSecurity("XKCD",-1);
+
+ Assert.assertTrue("Failed to transact", expected==actual);
+ }
+
+ @Test
+ public void testInvestmentAccountTradeSecurityPassedPositive_NotEnoughCash(){
+ InvestmentAccount ia = new InvestmentAccount(1,"R");
+ //ia.changeBalance(10000000);//Seed the account with cash
+ boolean expected=false;
+ boolean actual=ia.tradeSecurity("XKCD",1);
+
+ Assert.assertTrue("Failed to transact", expected==actual);
+ }
+
+ @Test
+ public void testInvestmentAccountTradeSecurityPassedNegative_NotEnoughShares(){
+ //Must create a security in order to sell it, so we repeat the
+ //code from "."_Positive(), above
+ InvestmentAccount ia = new InvestmentAccount(1,"R");
+ ia.changeBalance(10_000_000);//Seed the account with cash
+ boolean expected=false;
+ boolean actual=ia.tradeSecurity("XKCD",1);//Placeholder to generate security to sell
+ //We can reasonably expect that if, after running the sell, the value of the
+ //account's cash position is 10_000_000 - commission*2 then things ran smoothly.
+ //Another possibility for testing these methods?
+ //System.out.println("$10,000,000 - "+ia.getCommissionRate()*2+" = "+
+ // (10_000_000-(ia.getCommissionRate()*2)));
+ actual=ia.tradeSecurity("XKCD",-2);
+
+ Assert.assertTrue("Failed to transact", expected==actual);
+ }
+
+ @Test
+ public void testInvestmentAccountGetAccountTotalValue(){
+
+ double expected;
+ double actual;
+ double passCash=1000;
+ double sharesToTrade=10;
+ InvestmentAccount ia = new InvestmentAccount(1,"R");
+ ia.changeBalance(passCash);//Seed the account with cash
+ if (ia.tradeSecurity("XKCD", sharesToTrade))
+ {
+ actual=ia.getAccountTotalValue();
+ expected=(passCash) - ia.getCommissionRate();
+ }
+ else
+ {
+ actual=ia.getAccountTotalValue();
+ expected=passCash;
+ }
+
+ Assert.assertEquals(expected, actual, allowedDeltaDollars);
+ }
+
+//ACCOUNTFACTORY TESTS
+
+ @Test
+ public void testAccountFactoryCreateInvestment(){
+ InvestmentAccount ia = new InvestmentAccount(0);//Use minimal constructor to populate default
+ // fields for comparison
+ InvestmentAccount iaUserId= AccountFactory.createInvestment(1);
+ InvestmentAccount iaUserIdAndAccountName= AccountFactory.createInvestment(2,
+ "Retirement");
+ InvestmentAccount iaUserIdAccountNameAndCommissionRate= AccountFactory.createInvestment(3,
+ "Brokerage",
+ 6.95);
+ Assert.assertTrue("User ID failed",
+ iaUserId.getOwnerID()==1 &&
+ ia.getAccountName().equals(iaUserId.getAccountName()) &&
+ iaUserId.getCommissionRate()==ia.getCommissionRate());
+ Assert.assertTrue("User ID & AccountName failed",
+ iaUserIdAndAccountName.getOwnerID()==2 &&
+ "Retirement".equals(iaUserIdAndAccountName.getAccountName()) &&
+ iaUserIdAndAccountName.getCommissionRate()==ia.getCommissionRate());
+ Assert.assertTrue("User ID & AccountName & CommissionRate failed",
+ iaUserIdAccountNameAndCommissionRate.getOwnerID()==3 &&
+ "Brokerage".equals(iaUserIdAccountNameAndCommissionRate.getAccountName()) &&
+ iaUserIdAccountNameAndCommissionRate.getCommissionRate()==6.95);
+ }
+
+ @Test
+ public void testAccountFactoryCreateSaving(){
+ SavingAccount sa = new SavingAccount(0);//Use minimal constructor to populate default
+ // fields for comparison
+ SavingAccount saUserId= AccountFactory.createSaving(1);
+ SavingAccount saUserIdAndAccountName= AccountFactory.createSaving(2,
+ "For Boat");
+ SavingAccount saUserIdAccountNameAndInterestRate= AccountFactory.createSaving(3,
+ "For Beer",
+ 0.05);
+ Assert.assertTrue("User ID failed",
+ saUserId.getOwnerID()==1 &&
+ sa.getAccountName().equals(saUserId.getAccountName()) &&
+ saUserId.getInterestRate()==sa.getInterestRate());
+ Assert.assertTrue("User ID & AccountName failed",
+ saUserIdAndAccountName.getOwnerID()==2 &&
+ "For Boat".equals(saUserIdAndAccountName.getAccountName()) &&
+ saUserIdAndAccountName.getInterestRate()==sa.getInterestRate());
+ Assert.assertTrue("User ID & AccountName & InterestRate failed",
+ saUserIdAccountNameAndInterestRate.getOwnerID()==3 &&
+ "For Beer".equals(saUserIdAccountNameAndInterestRate.getAccountName()) &&
+ saUserIdAccountNameAndInterestRate.getInterestRate()==0.05);
+ }
+
+//SAVINGACCOUNT TESTS
+
+ @Test
+ public void testSavingAccountConstructors(){
+ SavingAccount sa = new SavingAccount(0);//Load defaults for comparisons
+
+ Assert.assertTrue(sa.getOwnerID()==0 &&
+ "Saving Account".equals(sa.getAccountName()) &&
+ sa.getInterestRate()==0.01);
+ }
+
+//CHECKINGACCOUNT TESTS
+
+}