//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldBeAbleToPackAndUnpackMap() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldBeAbleToPackAndUnpackMap() { // Given PackedOutputArray output = new PackedOutputArray(); Org.Neo4j.Bolt.messaging.Neo4jPack_Packer packer = _neo4jPack.newPacker(output); packer.PackMapHeader(ALICE.properties().size()); ALICE.properties().@foreach((s, value) => { try { packer.pack(s); packer.pack(value); } catch (IOException e) { throw new UncheckedIOException(e); } }); AnyValue unpacked = unpacked(output.Bytes()); // Then assertThat(unpacked, instanceOf(typeof(MapValue))); MapValue unpackedMap = ( MapValue )unpacked; assertThat(unpackedMap, equalTo(ALICE.properties())); }
//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))); }