//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldConvertDynamicAddedProperty()
        public virtual void ShouldConvertDynamicAddedProperty()
        {
            // GIVEN
            int            key    = 10;
            PropertyRecord before = PropertyRecord();
            PropertyRecord after  = PropertyRecord(Property(key, _longString));

            // THEN
            assertThat(Convert(_none, _none, Change(before, after)), equalTo(EntityUpdates.ForEntity(0, false).added(key, _longString).build()));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldIgnoreInlinedUnchangedProperty()
        public virtual void ShouldIgnoreInlinedUnchangedProperty()
        {
            // GIVEN
            int            key    = 10;
            Value          value  = Values.of(12341);
            PropertyRecord before = PropertyRecord(Property(key, value));
            PropertyRecord after  = PropertyRecord(Property(key, value));

            // WHEN
            assertThat(Convert(_none, _none, Change(before, after)), equalTo(EntityUpdates.ForEntity(0, false).build()));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldConvertDynamicInlinedRemovedProperty()
        public virtual void ShouldConvertDynamicInlinedRemovedProperty()
        {
            // GIVEN
            int            key    = 10;
            PropertyRecord before = PropertyRecord(Property(key, _longString));
            PropertyRecord after  = PropertyRecord();

            // WHEN
            EntityUpdates update = Convert(_none, _none, Change(before, after));

            // THEN
            EntityUpdates expected = EntityUpdates.ForEntity(0, false).removed(key, _longString).build();

            assertEquals(expected, update);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldConvertInlinedRemovedProperty()
        public virtual void ShouldConvertInlinedRemovedProperty()
        {
            // GIVEN
            int            key    = 10;
            Value          value  = Values.of(12341);
            PropertyRecord before = PropertyRecord(Property(key, value));
            PropertyRecord after  = PropertyRecord();

            // WHEN
            EntityUpdates update = Convert(_none, _none, Change(before, after));

            // THEN
            EntityUpdates expected = EntityUpdates.ForEntity(0, false).removed(key, value).build();

            assertEquals(expected, update);
        }
        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());
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldTreatPropertyThatMovedToAnotherRecordAsChange()
        public virtual void ShouldTreatPropertyThatMovedToAnotherRecordAsChange()
        {
            // GIVEN
            int   key      = 12;
            Value oldValue = Values.of("value1");
            Value newValue = Values.of("value two");

            Command.PropertyCommand movedFrom = Change(PropertyRecord(Property(key, oldValue)), PropertyRecord());
            Command.PropertyCommand movedTo   = Change(PropertyRecord(), PropertyRecord(Property(key, newValue)));

            // WHEN
            EntityUpdates update = Convert(_none, _none, movedFrom, movedTo);

            // THEN
            EntityUpdates expected = EntityUpdates.ForEntity(0, false).changed(key, oldValue, newValue).build();

            assertEquals(expected, update);
        }
Beispiel #7
0
 private EntityUpdates NodeUpdates(int nodeId, int propertyId, string propertyValue, params long[] labelIds)
 {
     return(EntityUpdates.ForEntity(( long )nodeId, false).withTokens(labelIds).withTokensAfter(labelIds).added(propertyId, Values.of(propertyValue)).build());
 }