Example #1
0
 public HttpResponseMessage Check([FromBody] string value)
 {
     if (string.IsNullOrEmpty(value))
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "No Text supplied"));
     }
     else
     {
         TermsLogic logic = new TermsLogic(Repository);
         return(Request.CreateResponse <List <ResponseMessage> >(HttpStatusCode.OK, logic.FindTerms(value)));
     }
 }
Example #2
0
        public void Initialize()
        {
            repository = new TermsRepository(testDataFile, cacheKey);
            testTerms  = new List <string>()
            {
                "term1", "term2"
            };

            MemoryCache cache = MemoryCache.Default;

            cache[cacheKey] = testTerms;

            logic = new TermsLogic(repository);
        }