예제 #1
0
 public void CreditTest()
 {
     BankAccount target = new BankAccount("Mr. Bryan Walton", 11.99); // TODO: Initialize to an appropriate value
     double amount = 0F; // TODO: Initialize to an appropriate value
     target.Credit(amount);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
예제 #2
0
파일: s44_a01.cs 프로젝트: mjmdesigns/IT
 public static void Main()
 {
     BankAccount ba = new BankAccount("Mr. Bryan Walton", 11.99); 
     ba.Credit(5.77);
     ba.Debit(11.22);
     Console.WriteLine("Current balance is ${0}", ba.Balance);
 }
예제 #3
0
 public void CreditTest()
 {
     var target = new BankAccount("Mr Brian Walton", 11.99);
     const double amount = 0.01;
     target.Credit(amount);
     Assert.AreEqual(12.00, target.Balance);
 }
 public void CreditTest()
 {
     BankAccount target = new BankAccount("Mr.Bryan Walton", 11.99);
     double amount = 11.22;
     target.Credit(amount);
     Assert.Inconclusive("Невозможно проверить метод, не возвращающий значение.");
 }
예제 #5
0
        public static void Main()
        {
            BankAccount ba = new BankAccount("yeyo", 11.99);

            ba.Credit(5.77);
            ba.Debit(11.22);
            Console.WriteLine("balance  ${0}", ba.Balance);
        }
예제 #6
0
        public static void Main()
        {
            BankAccount ba = new BankAccount("Mr.Theerawut Thaweephattharawong", 500); //เงืนเหลือ

            ba.Credit(1500);                                                           //ฝากเงินเพิ่ม
            ba.Debit(500);                                                             //ถอนเงิน
            Console.WriteLine("Current balance is ", ba.Balance);
        }
예제 #7
0
        public static void Main()
        {
            BankAccount ba = new BankAccount("mR. bRYAN wALTON", 11.99);

            ba.Credit(5.77);
            ba.Debit(11.22);
            Console.WriteLine("Current balance is ${0}", ba.Balance);
        }
        public static void Main()
        {
            BankAccount ba = new BankAccount("José da Silva", 29.45);

            ba.Credit(0.55);
            ba.Debit(10);
            Console.WriteLine("Your current balance is ${0}.", ba.balance);
        }
예제 #9
0
        public static void Main()
        {
            BankAccount ba = new BankAccount("Mr. Rayyan", 500.50);

            ba.Credit(00.50);
            ba.Debit(50.00);
            Console.WriteLine("Current balance is ${0}", ba.Balance);
        }
예제 #10
0
        public static void Main()
        {
            BankAccount ba = new BankAccount("Matti meikäläinen", 11.99);

            ba.Credit(5.77);
            ba.Debit(11.22);
            Console.WriteLine("Pankkitilin raha määrä ${0}", ba.Balance);
        }
예제 #11
0
        public static void Main()
        {
            BankAccount ba = new BankAccount("Mr. Bryan Walton", 11.99);

            ba.Credit(5.77);
            ba.Debit(11.22);
            Console.WriteLine("Current balance is ${0}", ba.Balance);
        }
예제 #12
0
파일: Program.cs 프로젝트: emalron/banktest
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            BankAccount ba = new BankAccount("Mr. Bryan Walton", 11.99);

            ba.Credit(5.77);
            ba.Debit(11.22);
            Console.WriteLine("Current balance is ${0}", ba.Balance);
        }
예제 #13
0
        public static void Main()
        {
            BankAccount ba = new BankAccount("Mr. Bryan Walton", 11.99);

            ba.Credit(5.77);
            ba.Debit(11.22);
            Console.WriteLine("Current balance is ${0}", ba.Balance);
            // don't need this line as I'm currently not able to run this program  Console.ReadLine();
        }
예제 #14
0
        public static void Main()
        {
            BankAccount ba = new BankAccount("Mr Fabien GAUDRON", 11.99);

            ba.Credit(5.77);
            ba.Debit(11.22);
            Console.WriteLine("Curent balance is {0}", ba.Balance);
            Console.ReadKey();
        }
        public static void Main()
        {
            BankAccount ba = new BankAccount("Mr Alex Kimutai", 11.30);

            ba.Credit(5.77);
            ba.Debit(11.22);
            Console.WriteLine("Current Balance is ${0}", ba.Balance);
            Console.ReadLine();
        }
예제 #16
0
 public void CreditTest()
 {
     //创建一个账户shenjl,余额为100元
     BankAccount bank = new BankAccount("shenjl", 100);
     //存款10元
     bank.Credit(10);
     //Assert在这里可以理解成断言:在VSTS里做单元测试是基于断言的测试
     //预计的结果是90元,如果等于实际的结果的话就通过,否则不通过。
     Assert.AreEqual(110, bank.Balance);
 }
예제 #17
0
 /// <summary>
 /// Metodo principal de ejecución
 /// </summary>
 /// <param name="args"></param>
 static void Main(string[] args)
 {
     try
     {
         BankAccount ba = new BankAccount("Roxana Zeceña", 1000);
         ba.Credit(500);
         ba.Debit(250);
         Console.WriteLine("Current balance is ${0}", ba.Balance);
         Console.ReadKey();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #18
0
        public void Credit_Balance()
        {
            // arrange
            double beginningBalance = 11.99;
            double creditAmount = 4.55;
            double expected = 16.54;
            BankAccount account = new BankAccount("Mr. Bryan Walton", beginningBalance);

            // act
            account.Credit(creditAmount);

            // assert
            double actual = account.Balance;
            Assert.AreEqual(expected, actual, "Account not credited correctly");
        }
        public static void Main(string[] args)
        {
            BankAccount ba   = new BankAccount("Mr. Bryan Walton", 12.25);
            Random      rand = new Random();

            for (int i = 0; i < 10; i++)
            {
                ba.Credit(Math.Round(rand.NextDouble() * MAX_AMOUNT, 2));
                Thread.Sleep(500);

                ba.Debit(Math.Round(rand.NextDouble() * MAX_AMOUNT, 2));
                Thread.Sleep(500);
            }

            Console.ReadKey();
        }
예제 #20
0
        public static void Main(string[] args)
        {
            /*
             * Avant modifications, ce programme cree un compte en banque au nom de Mr. Bryan Walton et y depose 12.25
             * Il execute ensuite 10 fois une sequence de deux operations:
             *  - Un credit d'un montant aletoire entre 0 et 100 dollars (MaxAmount)
             *  - Un debit d'un montant aletoire entre 0 et 100 dollars (MaxAmount)
             * A chacune de ces operations il refuse un nombre negatif ou un debit superieur a la balance du compte
             * Il affiche la blance apres chaque operation
             * toto
             */



            //BankAccount ba = new BankAccount("Mr. Bryan Walton", 12.25);
            //1) changement de nom
            BankAccount ba = new BankAccount("M. Julien Brunet", 12.25);

            Random rand = new Random();

            // for (int i = 0; i < 10 ; i++)
            //2) on ajoute 5 operations pour en avoir 15
            for (int i = 0; i < 15; i++)
            {
                ba.Credit(Math.Round(rand.NextDouble() * MaxAmount, 2));
                Thread.Sleep(500);

                //Je ne veux que 10 credits mais 15 debits
                if (i < 10)
                {
                    ba.Debit(Math.Round(rand.NextDouble() * MaxAmount, 2));
                    Thread.Sleep(500);
                }
            }

            Console.ReadKey();
        }