示例#1
0
        public void UrlEncoding_UTF8_Then_Hex()
        {
            //Arrange
            var service = new WitService(new WitModelAttribute("token", WitApiVersion.Standard));

            //Act
            var request = service.BuildRequest(new WitRequest("Français", "session"));

            // https://github.com/Microsoft/BotBuilder/issues/247
            //Assert
            Assert.AreNotEqual("https://api.wit.ai/converse?session_id=session&q=Fran%25u00e7ais", request.RequestUri.AbsoluteUri);
            Assert.AreEqual("https://api.wit.ai/converse?session_id=session&q=Fran%C3%A7ais", request.RequestUri.AbsoluteUri);
        }
示例#2
0
        public void UrlEncoding_UTF8_Then_Hex()
        {
            //Arrange
            var model   = new WitModelAttribute("token", WitApiVersionType.Latest).MakeWitModel();
            var service = new WitService(model);

            //Act
            var request = service.BuildRequest(new WitRequest("Français", "session"), model);

            // https://github.com/Microsoft/BotBuilder/issues/247
            //Assert
            Assert.AreNotEqual("https://api.wit.ai/message?thread_id=session&q=Fran%25u00e7ais", request.RequestUri.AbsoluteUri);
            Assert.AreEqual("https://api.wit.ai/message?thread_id=session&q=Fran%C3%A7ais", request.RequestUri.AbsoluteUri);
        }