Ejemplo n.º 1
0
        public void CanGetRevenueByCustomer()
        {
            RevenueReportFactory revenueReportFactory = new RevenueReportFactory();

            List <Report> RevenueByCustomer = revenueReportFactory.GetRevenueByCustomer();

            Assert.IsTrue(RevenueByCustomer.Count > 0);
            Assert.IsNotNull(RevenueByCustomer);
        }
        //Method Name: ReadInput
        //Purpose of the Method: This method selects a list of Reports displaying the amount of revenue generated for a customer and iterates over them to write the reports to the console.
        public static void ReadInput()
        {
            RevenueReportFactory revenueReportFactory = new RevenueReportFactory();

            Console.WriteLine("\r\n===================");
            Console.WriteLine("REVENUE BY CUSTOMER");
            Console.WriteLine("===================");

            List <Report> CustomerRevenueReports = new List <Report>();

            CustomerRevenueReports = revenueReportFactory.GetRevenueByCustomer();

            Console.WriteLine($"Customer      Revenue");

            foreach (Report report in CustomerRevenueReports)
            {
                Console.WriteLine($"{report.Name, -10} ${report.Price, -30}");
            }

            Console.WriteLine("\r\nPress any key to return to the main menu");
            Console.ReadLine();
        }