예제 #1
0
        public void TotalTest()
        {
            // var foolApp = new Program();
            var     sut = new FoolParadiseCalculator("chinazor", 1000, 40, 6);
            decimal tot = sut.Total(sut.Amount, sut.Interest, sut.Months);

            Assert.AreEqual(8400, tot);
        }
예제 #2
0
        public void TwoTotalTest()
        {
            //var foolApp = new Program();
            var     sut         = new FoolParadiseCalculator("Nato", 1000, 40, 6);
            decimal total       = sut.Total(1000, 40, 6);
            var     doubleTotal = total * 2;

            Assert.AreEqual(16800, doubleTotal);
        }
예제 #3
0
        public void TwoTotalTest()
        {
            //var foolApp = new Program();
            var     sut         = new FoolParadiseCalculator("Tosin", 1000, 40, 6);
            decimal total       = sut.Total(sut.Amount, sut.Interest, sut.Months);
            var     doubleTotal = total * 2;

            Assert.Equal(16800, doubleTotal);
        }
예제 #4
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello customer!");
            Console.Write("Welcome!. Kindly fill in the details below:\n");

            //Initialize the Program

            //Enter details
            Console.WriteLine("Enter your name");
            var name = Console.ReadLine();

            Console.WriteLine("Enter amount");
            var amount = decimal.Parse(Console.ReadLine());

            Console.WriteLine("Enter interest (in %)");
            var interest = decimal.Parse(Console.ReadLine());

            Console.WriteLine("Enter duration in months");
            var months = Int32.Parse(Console.ReadLine());

            var user = new FoolParadiseCalculator(name, amount, interest, months);

            try
            {
                var output = user.Deposit(name, amount, interest, months);
                Console.WriteLine(output);

                Console.WriteLine();
                Console.WriteLine("Total Interest");

                var depositResult = user.Total(user.Amount, user.Interest, user.Months);
                Console.WriteLine(depositResult);

                Console.WriteLine();
                Console.WriteLine("Net Interest");

                var netInterest = user.NetInterest(user.Interest, user.Months);
                Console.WriteLine(netInterest);
            }
            catch (Exception)
            {
                Console.WriteLine("Enter a valid month number: from 1 - 12");
            }
        }