Ejemplo n.º 1
0
        public void LocateClientT()
        {
            SearchHelper target = new SearchHelper(); // TODO: Initialize to an appropriate value

            string s = SerializeToJSON(new List<string> { "Steve","BIll","asdfas"});

            Console.Write(s);
        }
Ejemplo n.º 2
0
 public HttpResponseMessage Search(string query, string searchType)
 {
     try
     {//Need to use DI
         var searchHelper = new SearchHelper();
         var list = searchHelper.LocateClient(query, searchType);
         var totalPossible = searchHelper.CountClient(query, searchType);
         var listOfWords = searchHelper.GetWordList(query, searchType);
         return CreateResponse(list, totalPossible, listOfWords);
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(HandleExcpetion(ex));
     }
 }
Ejemplo n.º 3
0
        public CountResource()
        {
            try
            {
                //need DI here
                searchHelper = new SearchHelper();
            }
            catch (Exception ex)
            {
                var response = new HttpResponseMessage();
                response.StatusCode = HttpStatusCode.InternalServerError;
                response.Content = new StringContent(ex.ToString());
                throw new HttpResponseException(response);

            }
        }
Ejemplo n.º 4
0
        public HttpResponseMessage SearchByPeice(string name, string phone, string address, string policy)
        {
            try
            {
                //Need to use DI
                var searchHelper = new SearchHelper();
                var list = searchHelper.LocateClient(name, phone, address, policy);
                var totalPossible = searchHelper.CountClient(name, phone, address, policy);

                var listOfWords = new List<string>() {"NA"};
                //var listOfWords = searchHelper.GetWordList(name);
                return CreateResponse(list, totalPossible, listOfWords);
            }
            catch (Exception ex)
            {
                throw new HttpResponseException(HandleExcpetion(ex));
            }
        }
Ejemplo n.º 5
0
 public void LocateClientTest1()
 {
     SearchHelper target = new SearchHelper(); // TODO: Initialize to an appropriate value
     string name = "Steve"; // TODO: Initialize to an appropriate value
     string phone = "123"; // TODO: Initialize to an appropriate value
     string address = string.Empty; // TODO: Initialize to an appropriate value
     string policy = string.Empty; // TODO: Initialize to an appropriate value
     List<string> expected = null; // TODO: Initialize to an appropriate value
     List<string> actual;
     actual = target.LocateClient(name, phone, address, policy);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }