public void DepositTest() { //var foolApp = new Program(); var depot = new FoolParadiseCalculator("Segun", 2000, 100, 5); string depo = depot.Deposit(depot.Name, depot.Amount, depot.Interest, depot.Months); Assert.AreEqual($"Welcome Segun, your total should be ready in January. Thanks", depo); }
public void DepositTest() { var name = "Segun"; var amt = 2000; var percent = 100; var month = 5; var foolApp = new FoolParadiseCalculator(name, amt, percent, month); string depo = foolApp.Deposit(foolApp.Name, foolApp.Amount, foolApp.Interest, foolApp.Months); Assert.Equal($"Welcome Segun, your total should be ready in January. Thanks", depo); }
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"); } }