Train() public method

Make post with training xml data
public Train ( string xmlRequest ) : bool
xmlRequest string xml train data
return bool
Exemplo n.º 1
0
        public void TrainTest_ShouldMakeTrainXMLAndGetResponse()
        {
            WriteCalls classifierService = new WriteCalls();
            //string xmlQuery = XmlBuilder.TrainXML("פלאפל 4 טעמים", "Falafel");
            string xmlQuery = XmlBuilder.BuildTrainXML("פלאפל 4 טעמים", "falafel");

            //Act
            bool response = classifierService.Train(xmlQuery);

            //Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response);
        }
Exemplo n.º 2
0
        public void ParseTrainXMLResponse()
        {
            WriteCalls classifierService = new WriteCalls();
            string xmlQuery = XmlBuilder.BuildTrainXML("פלאפל 4 טעמים", "Falafel");

            //Act
            bool response = classifierService.Train(xmlQuery);
            //string response = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<uclassify xmlns=\"http://api.uclassify.com/1/ResponseSchema\" version=\"1.01\">\n\t<status success=\"true\" statusCode=\"2000\"/>\n\t<writeCalls>\n\t\t<train id=\"Train\"/>\n\t</writeCalls>\n</uclassify>";

            //bool responseStr = XmlReader.ParseTrainXMLResponse(response);

            //Assert
            Assert.IsTrue(response);
        }