Example #1
0
        public void TimedMaturityAccountConstructorTest()
        {
            TimedMaturityAccount target = new TimedMaturityAccount();

            Assert.IsNotNull(target);
            //Assert.Inconclusive("TODO: Implement code to verify target");
        }
Example #2
0
        public void CheckBalanceTest()
        {
            TimedMaturityAccount target = new TimedMaturityAccount(1000.0, new DateTime(2010, 6, 14), 0.05, 0.05); // TODO: Initialize to an appropriate value
            double expected             = 1000.0;                                                                  // TODO: Initialize to an appropriate value
            double actual;

            actual = target.CheckBalance();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
Example #3
0
        public void TimedMaturityAccountConstructorTest1()
        {
            double               bal      = 0F;           // TODO: Initialize to an appropriate value
            DateTime             date     = DateTime.Now; // TODO: Initialize to an appropriate value
            double               int_rate = 0.05;         // TODO: Initialize to an appropriate value
            double               pen_rate = 0.05;         // TODO: Initialize to an appropriate value
            TimedMaturityAccount target   = new TimedMaturityAccount(bal, date, int_rate, pen_rate);

            Assert.IsNotNull(target);
            //Assert.Inconclusive("TODO: Implement code to verify target");
        }
Example #4
0
        public void WithdrawTest1()
        {
            TimedMaturityAccount target = new TimedMaturityAccount(1000.0, new DateTime(2010, 6, 14), 0.05, 0.05);   // TODO: Initialize to an appropriate value
            double   amount             = 600;                                                                       // TODO: Initialize to an appropriate value
            DateTime paydate            = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day - 1); // TODO: Initialize to an appropriate value
            double   expected           = 600;                                                                       // TODO: Initialize to an appropriate value
            double   actual;

            actual = target.Withdraw(amount, paydate);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
Example #5
0
        public void TestDateMoney()
        {
            double               balance    = 12000;
            double               takeMoney  = 3000;
            double               interest   = 0.3;
            double               penalty    = 0.4;
            DateTime             dt         = new DateTime(2015, 12, 12);
            TimedMaturityAccount acc        = new TimedMaturityAccount(balance, interest, dt, penalty);
            double               answerReal = acc.takeMoney(takeMoney);
            double               answer;

            if (DateTime.Now >= dt)
            {
                answer = takeMoney;
            }
            else
            {
                answer = takeMoney - takeMoney * penalty;
            }
            Assert.AreEqual(answer, answerReal, "Wrong Timed Mature Method");
        }