public static Person makePerson(string userId, string person_name, string token) { // Set Instance bankInstance = new TestBank(); friendManagerInstance = new TestFriendManager(); Person person = new Person(userId, person_name, token, bankInstance, friendManagerInstance); return person; }
public void UnitTests() { var test = new TestBank(); Assert.AreEqual(0, test.Balance(CurrencyTypes.Game)); Assert.AreEqual(0, test.Balance(CurrencyTypes.Paid)); test.Deposit(new Price(CurrencyTypes.Game, 10)); Assert.AreEqual(10, test.Balance(CurrencyTypes.Game)); Assert.IsFalse(test.CanWithdraw(new Price(CurrencyTypes.Game, 20))); Assert.IsFalse(test.Withdraw(new Price(CurrencyTypes.Game, 20))); Assert.AreEqual(10, test.Balance(CurrencyTypes.Game)); Assert.IsTrue(test.Withdraw(new Price(CurrencyTypes.Game, 5))); Assert.AreEqual(5, test.Balance(CurrencyTypes.Game)); test.Clear(CurrencyTypes.Game); Assert.AreEqual(0, test.Balance(CurrencyTypes.Game)); }
static void Main(string[] args) { TestBank myConn = new TestBank(); myConn.ConnectToBankDB(); }