public static VirtualValue Path(params VirtualValue[] pathElements) { Debug.Assert(pathElements.Length % 2 == 1); NodeValue[] nodes = new NodeValue[pathElements.Length / 2 + 1]; RelationshipValue[] rels = new RelationshipValue[pathElements.Length / 2]; nodes[0] = ( NodeValue )pathElements[0]; for (int i = 1; i < pathElements.Length; i += 2) { rels[i / 2] = ( RelationshipValue )pathElements[i]; nodes[i / 2 + 1] = ( NodeValue )pathElements[i + 1]; } return(VirtualValues.Path(nodes, rels)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void pathShouldNotOnlyContainRelationship() internal virtual void PathShouldNotOnlyContainRelationship() { assertThrows(typeof(AssertionError), () => VirtualValues.Path(nodes(), relationships(1L))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void pathShouldHandleNullNodes() internal virtual void PathShouldHandleNullNodes() { assertThrows(typeof(AssertionError), () => VirtualValues.Path(null, relationships(1L))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void pathShouldHandleNullEdge() internal virtual void PathShouldHandleNullEdge() { assertThrows(typeof(AssertionError), () => VirtualValues.Path(nodes(1L), null)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void pathShouldContainOneMoreNodeThenEdges() internal virtual void PathShouldContainOneMoreNodeThenEdges() { assertThrows(typeof(Exception), () => VirtualValues.Path(nodes(1L, 2L), relationships())); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Parameterized.Parameters(name = "{0}") public static Iterable<WriteTest> data() public static IEnumerable <WriteTest> Data() { return(Arrays.asList(ShouldWrite(VirtualValues.List(booleanValue(false), byteArray(new sbyte[] { 3, 4, 5 }), stringValue("yo")), beginList(3), false, Specials.byteArray(new sbyte[] { 3, 4, 5 }), "yo", endList()), ShouldWrite(VirtualValues.Map(new string[] { "foo", "bar" }, new AnyValue[] { intValue(100), charValue('c') }), beginMap(2), "bar", 'c', "foo", 100, endMap()), ShouldWrite(VirtualValues.Node(1L), writeNodeReference(1L)), ShouldWrite(relationship(2L), writeRelationshipReference(2L)), ShouldWrite(VirtualValues.Path(new NodeValue[] { nodeValue(20L, stringArray("L"), emptyMap()), nodeValue(40L, stringArray("L"), emptyMap()) }, new RelationshipValue[] { relationshipValue(100L, nodeValue(40L, stringArray("L"), emptyMap()), nodeValue(20L, stringArray("L"), emptyMap()), stringValue("T"), emptyMap()) }), writePath(new NodeValue[] { nodeValue(20L, stringArray("L"), emptyMap()), nodeValue(40L, stringArray("L"), emptyMap()) }, new RelationshipValue[] { relationshipValue(100L, nodeValue(40L, stringArray("L"), emptyMap()), nodeValue(20L, stringArray("L"), emptyMap()), stringValue("T"), emptyMap()) })), ShouldWrite(VirtualValues.Map(new string[] { "foo" }, new AnyValue[] { VirtualValues.List(VirtualValues.Map(new string[] { "bar" }, new AnyValue[] { VirtualValues.List() })) }), beginMap(1), "foo", beginList(1), beginMap(1), "bar", beginList(0), endList(), endMap(), endList(), endMap()), ShouldWrite(nodeValue(1337L, stringArray("L1", "L2"), map(new string[] { "foo" }, new AnyValue[] { stringValue("foo") })), writeNode(1337L, stringArray("L1", "L2"), map(new string[] { "foo" }, new AnyValue[] { stringValue("foo") }))), ShouldWrite(relationshipValue(1337L, nodeValue(42L, stringArray("L"), emptyMap()), nodeValue(43L, stringArray("L"), emptyMap()), stringValue("T"), map(new string[] { "foo" }, new AnyValue[] { stringValue("foo") })), writeRelationship(1337L, 42L, 43L, stringValue("T"), map(new string[] { "foo" }, new AnyValue[] { stringValue("foo") }))))); }