public void ShouldReturnStringThatComparesMonthlyPayments(string expected)
        {
            // Arrange
            // Act
            string actual = clientProcessor.CompareMonthlyPayments(customers[0]);

            // Assert
            Assert.Equal(expected, actual);
        }
Example #2
0
        private void KeyboardController()
        {
            var customer = clientProcessor.GetCustomerByCustomerId(customers, CustomerId);
            var key      = Console.ReadKey().Key;

            Console.WriteLine();
            switch (key)
            {
            case ConsoleKey.D1:
            case ConsoleKey.NumPad1:
                Console.WriteLine(clientProcessor.CompareMonthlyPayments(customer));
                break;

            case ConsoleKey.D2:
            case ConsoleKey.NumPad2:
                Console.WriteLine("Press NUM 1 to see this month or any key to see last month");
                var tempKey = Console.ReadKey().Key;
                Console.WriteLine();
                if (tempKey == ConsoleKey.D1 || tempKey == ConsoleKey.NumPad1)
                {
                    PrintList(customer, Month.ThisMonth);
                }
                else
                {
                    PrintList(customer, Month.LastMonth);
                }
                break;

            case ConsoleKey.D3:
            case ConsoleKey.NumPad3:
                clientProcessor.SpendingAlert(customer, clientProcessor.CompareSpendings(customer), "This month you have spent 150% more in these categories: ");
                break;

            case ConsoleKey.D4:
            case ConsoleKey.NumPad4:
                clientProcessor.SpendingAlert(customer, clientProcessor.GetCategoryWithAboveLimit(customer, 10, Month.ThisMonth), "You have reached your monthly limit in these categories: ");
                break;

            case ConsoleKey.Escape:
                State = false;
                break;

            default:
                break;
            }
        }