public void ShouldGetCategoriesAboveLimit(string expected, int limit, Month month)
        {
            // Arrange
            // Act
            string actual = "";
            var    result = clientProcessor.GetCategoryWithAboveLimit(customers[0], limit, month);

            foreach (var item in result)
            {
                actual += $"{item}";
            }
            // Assert
            Assert.Equal(expected, actual);
        }
Ejemplo n.º 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;
            }
        }