예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldServePropertyKeysAndRelationshipLabelsFromSuppliedArrayCaches()
        internal virtual void ShouldServePropertyKeysAndRelationshipLabelsFromSuppliedArrayCaches()
        {
            // given
            RecordAccess                @delegate         = mock(typeof(RecordAccess));
            PropertyKeyTokenRecord      propertyKey0      = new PropertyKeyTokenRecord(0);
            PropertyKeyTokenRecord      propertyKey2      = new PropertyKeyTokenRecord(2);
            PropertyKeyTokenRecord      propertyKey1      = new PropertyKeyTokenRecord(1);
            RelationshipTypeTokenRecord relationshipType0 = new RelationshipTypeTokenRecord(0);
            RelationshipTypeTokenRecord relationshipType1 = new RelationshipTypeTokenRecord(1);
            RelationshipTypeTokenRecord relationshipType2 = new RelationshipTypeTokenRecord(2);
            LabelTokenRecord            label0            = new LabelTokenRecord(0);
            LabelTokenRecord            label1            = new LabelTokenRecord(1);
            LabelTokenRecord            label2            = new LabelTokenRecord(2);

            CacheSmallStoresRecordAccess recordAccess = new CacheSmallStoresRecordAccess(@delegate, new PropertyKeyTokenRecord[] { propertyKey0, propertyKey1, propertyKey2 }, new RelationshipTypeTokenRecord[] { relationshipType0, relationshipType1, relationshipType2 }, new LabelTokenRecord[] { label0, label1, label2 });

            // when
            assertThat(recordAccess.PropertyKey(0), IsDirectReferenceTo(propertyKey0));
            assertThat(recordAccess.PropertyKey(1), IsDirectReferenceTo(propertyKey1));
            assertThat(recordAccess.PropertyKey(2), IsDirectReferenceTo(propertyKey2));
            assertThat(recordAccess.RelationshipType(0), IsDirectReferenceTo(relationshipType0));
            assertThat(recordAccess.RelationshipType(1), IsDirectReferenceTo(relationshipType1));
            assertThat(recordAccess.RelationshipType(2), IsDirectReferenceTo(relationshipType2));
            assertThat(recordAccess.Label(0), IsDirectReferenceTo(label0));
            assertThat(recordAccess.Label(1), IsDirectReferenceTo(label1));
            assertThat(recordAccess.Label(2), IsDirectReferenceTo(label2));

            // then
            verifyZeroInteractions(@delegate);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldDelegateLookupForMostStores()
        internal virtual void ShouldDelegateLookupForMostStores()
        {
            // given
            RecordAccess @delegate = mock(typeof(RecordAccess));
            CacheSmallStoresRecordAccess recordAccess = new CacheSmallStoresRecordAccess(@delegate, null, null, null);

            // when
            recordAccess.Node(42);
            recordAccess.Relationship(2001);
            recordAccess.Property(2468);
            recordAccess.String(666);
            recordAccess.Array(11);

            // then
            verify(@delegate).node(42);
            verify(@delegate).relationship(2001);
            verify(@delegate).property(2468);
            verify(@delegate).@string(666);
            verify(@delegate).array(11);
        }