public void respond_with_httpmessage_text_message()
        {
            var url = _serverEndPoint.ToHttpUrl("/ping?format=json");
            Func <HttpResponse, bool> verifier = response => Codec.Json.From <HttpMessage.TextMessage>(response.Body) != null;

            var result = _portableServer.StartServiceAndSendRequest(HttpBootstrap.RegisterPing, url, verifier);

            Assert.IsTrue(result.Item1, result.Item2);
        }
示例#2
0
        public void handle_invalid_characters_in_url()
        {
            var url = _serverEndPoint.ToHttpUrl("/ping^\"");
            Func <HttpResponse, bool> verifier = response => string.IsNullOrEmpty(response.Body) &&
                                                 response.HttpStatusCode == (int)HttpStatusCode.NotFound;

            var result = _portableServer.StartServiceAndSendRequest(HttpBootstrap.RegisterPing, url, verifier);

            Assert.IsTrue(result.Item1, result.Item2);
        }