Exemplo n.º 1
0
 private void AssertGroups(EntityCommandGrouper.Cursor cursor, params Group[] groups)
 {
     foreach (Group group in groups)
     {
         if (group.Empty)
         {
             continue;
         }
         assertTrue(cursor.NextEntity());
         group.AssertGroup(cursor);
     }
     assertFalse(cursor.NextEntity());
 }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @EnumSource(Factory.class) void shouldHandleEmptyList(Factory factory)
        internal virtual void ShouldHandleEmptyList(Factory factory)
        {
            // given
            EntityCommandGrouper grouper = new EntityCommandGrouper <>(factory.command(0).GetType(), 8);

            // when
            EntityCommandGrouper.Cursor cursor = grouper.sortAndAccessGroups();
            bool hasNext = cursor.NextEntity();

            // then
            assertFalse(hasNext);
        }
        private EntityUpdates Convert(long[] labelsBefore, long[] labelsAfter, params Command.PropertyCommand[] changes)
        {
            long nodeId = 0;

            EntityUpdates.Builder updates = EntityUpdates.ForEntity(( long )0, false).withTokens(labelsBefore).withTokensAfter(labelsAfter);
            EntityCommandGrouper  grouper = new EntityCommandGrouper <>(typeof(Command.NodeCommand), 8);

            grouper.add(new Command.NodeCommand(new NodeRecord(nodeId), new NodeRecord(nodeId)));
            foreach (Command.PropertyCommand change in changes)
            {
                grouper.add(change);
            }
            EntityCommandGrouper.Cursor cursor = grouper.sortAndAccessGroups();
            assertTrue(cursor.NextEntity());
            _converter.convertPropertyRecord(cursor, updates);
            return(updates.Build());
        }