Example #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();
        }
Example #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 TestCalculateDistanceMethodWithSameTwoLocations()
 {
     CalculateDistance c = new CalculateDistance();
     Assert.IsTrue(c.Calculate(53.3381985, -6.2592576, 53.3381985, -6.2592576) == 0);
 }
 public void TestCalculateDistanceMethodWithExpectation()
 {
     CalculateDistance c = new CalculateDistance();
     Assert.IsTrue(Math.Abs(c.Calculate(52.986375, -6.043701, 53.3381985, -6.2592576) - 41.62) < 0.5);
 }