コード例 #1
0
ファイル: PersonFactory.cs プロジェクト: pinthecloud/debtor
 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;
 }
コード例 #2
0
        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));
        }
コード例 #3
0
        static void Main(string[] args)
        {
            TestBank myConn = new TestBank();

            myConn.ConnectToBankDB();
        }