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

            // When
            ISet <ConstraintDescriptor> constraints = asSet(StorageReader.constraintsGetForLabel(LabelId(Label1)));

            // 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);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldListAllConstraintsForLabel()
        public virtual void ShouldListAllConstraintsForLabel()
        {
            // Given
            SchemaHelper.createNodePropertyExistenceConstraint(Db, Label1, PropertyKey);
            SchemaHelper.createNodePropertyExistenceConstraint(Db, Label2, PropertyKey);

            SchemaHelper.createUniquenessConstraint(Db, Label1, PropertyKey);
            SchemaHelper.createNodeKeyConstraint(Db, Label1, OtherPropertyKey);
            SchemaHelper.createNodeKeyConstraint(Db, Label2, OtherPropertyKey);

            SchemaHelper.awaitIndexes(Db);

            // When
            ISet <ConstraintDescriptor> constraints = asSet(StorageReader.constraintsGetForLabel(LabelId(Label1)));

            // Then
            ISet <ConstraintDescriptor> expectedConstraints = asSet(UniqueConstraintDescriptor(Label1, PropertyKey), NodeKeyConstraintDescriptor(Label1, OtherPropertyKey), NodePropertyExistenceDescriptor(Label1, PropertyKey));

            assertEquals(expectedConstraints, constraints);
        }