コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGetCorrectContentEncodingRetrievingProperties() throws org.neo4j.server.rest.domain.JsonParseException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldGetCorrectContentEncodingRetrievingProperties()
        {
            string asianText  = "\u4f8b\u5b50";
            string germanText = "öäüÖÄÜß";

            string complicatedString = asianText + germanText;

            string entity = JsonHelper.createJsonFrom(Collections.singletonMap("foo", complicatedString));
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final RestRequest request = req;
            RestRequest   request        = _req;
            JaxRsResponse createResponse = request.Post(_functionalTestHelper.dataUri() + "node/", entity);
            string        response       = ( string )JsonHelper.readJson(request.Get(GetPropertyUri(createResponse.Location.ToString(), "foo")).Entity);

            assertEquals(complicatedString, response);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGetCorrectContentEncodingRetrievingPropertiesWithStreaming() throws org.neo4j.server.rest.domain.JsonParseException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldGetCorrectContentEncodingRetrievingPropertiesWithStreaming()
        {
            string asianText  = "\u4f8b\u5b50";
            string germanText = "öäüÖÄÜß";

            string complicatedString = asianText + germanText;

            string entity = JsonHelper.createJsonFrom(Collections.singletonMap("foo", complicatedString));
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final RestRequest request = req.header(org.neo4j.server.rest.repr.formats.StreamingJsonFormat.STREAM_HEADER, "true");
            RestRequest   request        = _req.header(StreamingJsonFormat.STREAM_HEADER, "true");
            JaxRsResponse createResponse = request.Post(_functionalTestHelper.dataUri() + "node/", entity);
            string        response       = ( string )JsonHelper.readJson(request.Get(GetPropertyUri(createResponse.Location.ToString(), "foo"), new MediaType("application", "json", stringMap("stream", "true"))).Entity);

            assertEquals(complicatedString, response);
        }