コード例 #1
0
        public void TestFindTerms()
        {
            List <ResponseMessage> findTermResults = logic.FindTerms("Term1 is there");

            Assert.AreEqual(testTerms.Count, findTermResults.Count);

            Assert.IsTrue(findTermResults.Find(t => t.Term == "term1").Message == "Match found 'Term1'");
            Assert.IsTrue(findTermResults.Find(t => t.Term == "term2").Message == "No Match");
        }
コード例 #2
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)));
     }
 }