Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldListAllIndexesAtTimeOfSnapshot()
        public virtual void ShouldListAllIndexesAtTimeOfSnapshot()
        {
            // Given
            CreateIndex(Label1, PropertyKey);

            // When
            StorageSchemaReader snapshot = StorageReader.schemaSnapshot();

            CreateIndex(Label2, PropertyKey);
            ISet <CapableIndexDescriptor> indexes = asSet(snapshot.IndexesGetAll());

            // Then
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Set<?> expectedIndexes = asSet(indexDescriptor(label1, propertyKey));
            ISet <object> expectedIndexes = asSet(IndexDescriptor(Label1, PropertyKey));

            assertEquals(expectedIndexes, indexes);
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldListAllConstraintsAtTimeOfSnapshot()
        public virtual void ShouldListAllConstraintsAtTimeOfSnapshot()
        {
            // Given
            CreateUniquenessConstraint(Label1, PropertyKey);

            // When
            StorageSchemaReader snapshot = StorageReader.schemaSnapshot();

            CreateUniquenessConstraint(Label2, PropertyKey);
            ISet <ConstraintDescriptor> constraints = asSet(snapshot.ConstraintsGetAll());

            // Then
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Set<?> expectedConstraints = asSet(uniqueConstraintDescriptor(label1, propertyKey));
            ISet <object> expectedConstraints = asSet(UniqueConstraintDescriptor(Label1, PropertyKey));

            assertEquals(expectedConstraints, constraints);
        }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void gettingIndexStateOfDroppedIndexViaSnapshotShouldThrow()
        public virtual void GettingIndexStateOfDroppedIndexViaSnapshotShouldThrow()
        {
            // Given
            CreateIndex(Label1, PropertyKey);

            // When
            StorageSchemaReader snapshot = StorageReader.schemaSnapshot();

            DropIndex(Label1, PropertyKey);
            try
            {
                snapshot.IndexGetState(IndexDescriptor(Label1, PropertyKey));
                fail("Should have thrown exception when asking for state of dropped index.");
            }
            catch (IndexNotFoundKernelException)
            {
                // Good.
            }
        }