public void balanceAccessorModifierTest() { Trader t = new Trader(); t.setBalance(1050); Assert.AreEqual(t.getBalance(), 1050); }
public void constructorTest() { Trader t2 = new Trader("Player2", 1500); Assert.AreEqual(t2.getName(), "Player2"); Assert.AreEqual(t2.getBalance(), 1500); }
public void nameAccessorModifierTest() { Trader t = new Trader(); t.setName("Banker"); Assert.AreEqual(t.getName(), "Banker"); }
public void payTest() { Trader t = new Trader("Player1", 1500); t.pay(111); Assert.AreEqual(t.getBalance(), 1500 - 111); }
public void receiveTest() { Trader t = new Trader("Player1", 1500); t.receive(55); Assert.AreEqual(t.getBalance(), 1555); }
public void checkBankruptZero() { Trader t = new Trader("Player1", 0); try { t.checkBankrupt();//exception should be thrown so should not run follwing line Assert.Fail(); } catch (Exception ex) { Console.Write("Exception Thrown: " + ex.Message); } }
public void checkBankrupt() { Trader t = new Trader("Player1", 1500); try { t.checkBankrupt();//nothing should happen (no exception thrown) } catch (Exception ex) { Console.Write("Exception Thrown: " + ex.Message); Assert.Fail(); } }
public Property(string sName, ref Trader owner) { this.sName = sName; this.owner = owner; }
public Property(string sName) { this.sName = sName; this.owner = Banker.access(); }
public void outputToString() { Trader t = new Trader(); Console.Write(t); }
public void propetyTest() { Trader t = new Trader(); Property p = new Property("Queen Street"); t.obtainProperty(ref p); Assert.Contains(p, t.getPropertiesOwned()); }
public void setOwner(ref Player newOwner) { this.owner = newOwner; }
public void setOwner(ref Banker newOwner) { this.owner = newOwner; }