예제 #1
0
        static void Main(string[] args)
        {
            IRetreiveFile retriver = new GetJsonText();
            ICalculate calc = new CalculateDistance();
            GetCustomersCloseToIntercom getCustomerLists = new GetCustomersCloseToIntercom();
            Console.WriteLine("Please type in your customers json file location");
            string jsonFileLocation = Console.ReadLine();

            List<Customer> customers = getCustomerLists.RetrieveCustomers(retriver,jsonFileLocation);
            List<Customer> requiredCustomers = getCustomerLists.GetRequiredCustomers(calc, customers);
            Console.WriteLine();
            Console.WriteLine("Customers within 100k from our office are listed below: ");
            foreach (Customer c in requiredCustomers)
            {
                Console.WriteLine(c.ToString());
            }
            Console.Read();
        }
예제 #2
0
        static void Main(string[] args)
        {
            IRetreiveFile retriver = new GetJsonText();
            ICalculate    calc     = new CalculateDistance();
            GetCustomersCloseToIntercom getCustomerLists = new GetCustomersCloseToIntercom();

            Console.WriteLine("Please type in your customers json file location");
            string jsonFileLocation = Console.ReadLine();

            List <Customer> customers         = getCustomerLists.RetrieveCustomers(retriver, jsonFileLocation);
            List <Customer> requiredCustomers = getCustomerLists.GetRequiredCustomers(calc, customers);

            Console.WriteLine();
            Console.WriteLine("Customers within 100k from our office are listed below: ");
            foreach (Customer c in requiredCustomers)
            {
                Console.WriteLine(c.ToString());
            }
            Console.Read();
        }
 public void ReadInJsonWithNullPath()
 {
     GetJsonText g = new GetJsonText();
     string path = null;
     Assert.IsTrue(g.GetCustomersFromJsonFile(path) == null);
 }