Exemple #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void writeNode(long nodeId, org.neo4j.values.storable.TextArray labels, org.neo4j.values.virtual.MapValue properties) throws java.io.IOException
            public override void WriteNode(long nodeId, TextArray labels, MapValue properties)
            {
                PackStructHeader(NODE_SIZE, NODE);
                Pack(nodeId);
                PackListHeader(labels.Length());
                for (int i = 0; i < labels.Length(); i++)
                {
                    labels.Value(i).writeTo(this);
                }
                properties.WriteTo(this);
            }
Exemple #2
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(")");
        }
Exemple #3
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)));
        }