コード例 #1
0
ファイル: NodeLabelRangeTest.cs プロジェクト: Neo4Net/Neo4Net
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRebaseOnRangeId()
        public virtual void ShouldRebaseOnRangeId()
        {
            // given
            long[][] labelsPerNode = new long[][]
            {
                new long[] { 1 },
                new long[] { 1, 3 },
                new long[] { 3, 5, 7 },
                new long[] {},
                new long[] { 1, 5, 7 },
                new long[] {},
                new long[] {},
                new long[] { 1, 2, 3, 4 }
            };

            // when
            NodeLabelRange range = new NodeLabelRange(10, labelsPerNode);

            // then
            long baseNodeId = range.Id() * labelsPerNode.Length;

            long[] expectedNodeIds = new long[labelsPerNode.Length];
            for (int i = 0; i < expectedNodeIds.Length; i++)
            {
                expectedNodeIds[i] = baseNodeId + i;
            }
            assertArrayEquals(expectedNodeIds, range.Nodes());
        }
コード例 #2
0
ファイル: NodeLabelRangeTest.cs プロジェクト: Neo4Net/Neo4Net
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldTransposeNodeIdsAndLabelIds()
        public virtual void ShouldTransposeNodeIdsAndLabelIds()
        {
            // given
            long[][] labelsPerNode = new long[][]
            {
                new long[] { 1 },
                new long[] { 1, 3 },
                new long[] { 3, 5, 7 },
                new long[] {},
                new long[] { 1, 5, 7 },
                new long[] {},
                new long[] {},
                new long[] { 1, 2, 3, 4 }
            };

            // when
            NodeLabelRange range = new NodeLabelRange(0, labelsPerNode);

            // then
            assertArrayEquals(new long[] { 0, 1, 2, 3, 4, 5, 6, 7 }, range.Nodes());
            for (int i = 0; i < labelsPerNode.Length; i++)
            {
                assertArrayEquals(labelsPerNode[i], range.Labels(i));
            }
        }