示例#1
0
        private static JsonNode GetSingle(JsonNode node, string key)
        {
            JsonNode data = node.get(key);

            assertEquals(1, data.size());
            return(data.get(0));
        }
示例#2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static org.codehaus.jackson.JsonNode getSingleData(org.neo4j.test.server.HTTP.Response response) throws org.neo4j.server.rest.domain.JsonParseException
        private static JsonNode GetSingleData(HTTP.Response response)
        {
            JsonNode data = response.Get("results").get(0).get("data");

            assertEquals(1, data.size());
            return(data.get(0));
        }
示例#3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void assertTypeEqual(String expectedType, org.neo4j.test.server.HTTP.Response response) throws org.neo4j.server.rest.domain.JsonParseException
        private static void AssertTypeEqual(string expectedType, HTTP.Response response)
        {
            JsonNode data = response.Get("results").get(0).get("data");
            JsonNode meta = data.get(0).get("meta");

            assertEquals(1, meta.size());
            assertEquals(expectedType, meta.get(0).get("type").asText());
        }
示例#4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static org.codehaus.jackson.JsonNode extractSingleElement(org.neo4j.test.server.HTTP.Response response) throws org.neo4j.server.rest.domain.JsonParseException
        private static JsonNode ExtractSingleElement(HTTP.Response response)
        {
            JsonNode data = response.Get("results").get(0).get("data");

            assertEquals(1, data.size());
            JsonNode row = data.get(0).get("row");

            assertEquals(1, row.size());
            return(row.get(0));
        }
示例#5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldWriteNestedMaps() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldWriteNestedMaps()
        {
            MemoryStream  @out = new MemoryStream();
            JsonGenerator json = (new JsonFactory(new Neo4jJsonCodec())).createJsonGenerator(@out);

            JsonNode row = Serialize(@out, json, new RowWriter());

            MatcherAssert.assertThat(row.size(), equalTo(1));
            JsonNode firstCell = row.get(0);

            MatcherAssert.assertThat(firstCell.get("one").get("two").size(), @is(2));
            MatcherAssert.assertThat(firstCell.get("one").get("two").get(0).asBoolean(), @is(true));
            MatcherAssert.assertThat(firstCell.get("one").get("two").get(1).get("three").asInt(), @is(42));
        }