Exemplo n.º 1
0
        public override void WriteNode(long nodeId, TextArray labels, MapValue properties)
        {
            Append(format("(id=%d", nodeId));
            string sep = " ";

            for (int i = 0; i < labels.Length(); i++)
            {
                Append(sep);
                Append(":" + labels.StringValue(i));
                sep = "";
            }
            if (properties.Size() > 0)
            {
                Append(" ");
                properties.WriteTo(this);
            }

            Append(")");
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldBeAbleToPackAndUnpackList() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldBeAbleToPackAndUnpackList()
        {
            // Given
            PackedOutputArray output = new PackedOutputArray();

            Org.Neo4j.Bolt.messaging.Neo4jPack_Packer packer = _neo4jPack.newPacker(output);
            packer.PackListHeader(ALICE.labels().length());
            IList <string> expected = new List <string>();
            TextArray      labels   = ALICE.labels();

            for (int i = 0; i < labels.Length(); i++)
            {
                string labelName = labels.StringValue(i);
                packer.Pack(labelName);
                expected.Add(labelName);
            }
            AnyValue unpacked = unpacked(output.Bytes());

            // Then
            assertThat(unpacked, instanceOf(typeof(ListValue)));
            ListValue unpackedList = ( ListValue )unpacked;

            assertThat(unpackedList, equalTo(ValueUtils.asListValue(expected)));
        }