Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldListRemovedRelationshipProperties() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldListRemovedRelationshipProperties()
        {
            // Given
            int   propertyKeyId = _ops.propertyKeyTokenHolder().getOrCreateId("theKey");
            Value prevValue     = Values.of("prevValue");

            _state.relationshipDoRemoveProperty(1L, propertyKeyId);
            _ops.withRelationship(1, 0, 0, 0, genericMap("theKey", prevValue));

            // When
            IEnumerable <PropertyEntry <Relationship> > propertyEntries = Snapshot().removedRelationshipProperties();

            // Then
            PropertyEntry <Relationship> entry = single(propertyEntries);

            assertThat(entry.Key(), equalTo("theKey"));
            assertThat(entry.PreviouslyCommitedValue(), equalTo("prevValue"));
            assertThat(entry.Entity().Id, equalTo(1L));
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldListAddedNodePropertiesProperties() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldListAddedNodePropertiesProperties()
        {
            // Given
            int   propertyKeyId = _ops.propertyKeyTokenHolder().getOrCreateId("theKey");
            Value prevValue     = Values.of("prevValue");

            _state.nodeDoChangeProperty(1L, propertyKeyId, Values.of("newValue"));
            _ops.withNode(1, _noLabels, genericMap("theKey", prevValue));

            // When
            IEnumerable <PropertyEntry <Node> > propertyEntries = Snapshot().assignedNodeProperties();

            // Then
            PropertyEntry <Node> entry = single(propertyEntries);

            assertThat(entry.Key(), equalTo("theKey"));
            assertThat(entry.Value(), equalTo("newValue"));
            assertThat(entry.PreviouslyCommitedValue(), equalTo("prevValue"));
            assertThat(entry.Entity().Id, equalTo(1L));
        }
Ejemplo n.º 3
0
        internal virtual PropertyEntryImpl <T> FetchExpectedPropertyEntry <T>(IDictionary <T, IDictionary <string, PropertyEntryImpl <T> > > map, PropertyEntry <T> entry) where T : Org.Neo4j.Graphdb.PropertyContainer
        {
            T    entity    = entry.Entity();
            bool hasEntity = map.ContainsKey(entity);

            if (_ignoreAdditionalData && !hasEntity)
            {
                return(null);
            }
            assertTrue("Unexpected entity " + entry, hasEntity);
            IDictionary <string, PropertyEntryImpl <T> > innerMap = map[entity];
            PropertyEntryImpl <T> expectedEntry = innerMap.Remove(entry.Key());

            if (expectedEntry == null && _ignoreAdditionalData)
            {
                return(null);
            }
            assertNotNull("Unexpected property entry " + entry, expectedEntry);
            if (innerMap.Count == 0)
            {
                map.Remove(entity);
            }
            return(expectedEntry);
        }
Ejemplo n.º 4
0
 internal virtual void BasicCompareTo(PropertyEntry <T> entry)
 {
     assertEquals(entry.Entity(), Entity());
     assertEquals(entry.Key(), Key());
     AssertEqualsMaybeNull(entry.PreviouslyCommitedValue(), PreviouslyCommitedValue(), entry.Entity(), entry.Key());
 }
Ejemplo n.º 5
0
 internal virtual void CompareToAssigned(PropertyEntry <T> entry)
 {
     BasicCompareTo(entry);
     AssertEqualsMaybeNull(entry.Value(), Value(), entry.Entity(), entry.Key());
 }