Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSetLatestConstraintRule() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldSetLatestConstraintRule()
        {
            // Given
            SchemaRecord beforeRecords = Serialize(_rule, _id, true, true);
            SchemaRecord afterRecords  = Serialize(_rule, _id, true, false);

            when(_neoStores.SchemaStore).thenReturn(_schemaStore);
            when(_neoStores.MetaDataStore).thenReturn(_metaDataStore);

            ConstraintRule schemaRule = ConstraintRule.constraintRule(_id, ConstraintDescriptorFactory.uniqueForLabel(_labelId, _propertyKey), 0);

            // WHEN
            VisitSchemaRuleCommand(_storeApplier, new Command.SchemaRuleCommand(beforeRecords, afterRecords, schemaRule));

            // THEN
            verify(_schemaStore).updateRecord(Iterables.first(afterRecords));
            verify(_metaDataStore).LatestConstraintIntroducingTx = _txId;
        }
Пример #2
0
 public static ConstraintRule RelPropertyExistenceConstraintRule(long ruleId, int labelId, int propertyId)
 {
     return(ConstraintRule.constraintRule(ruleId, ConstraintDescriptorFactory.existsForRelType(labelId, propertyId)));
 }
Пример #3
0
 public static ConstraintRule UniquenessConstraintRule(long ruleId, int labelId, int propertyId, long indexId)
 {
     return(ConstraintRule.constraintRule(ruleId, ConstraintDescriptorFactory.uniqueForLabel(labelId, propertyId), indexId));
 }
Пример #4
0
 public override ConstraintRule CreateUniquenessConstraintRule(long ruleId, UniquenessConstraintDescriptor descriptor, long indexId)
 {
     return(ConstraintRule.constraintRule(ruleId, descriptor, indexId));
 }
Пример #5
0
 public override ConstraintRule CreateExistenceConstraint(long ruleId, ConstraintDescriptor descriptor)
 {
     return(ConstraintRule.constraintRule(ruleId, descriptor));
 }
Пример #6
0
 public override ConstraintRule CreateNodeKeyConstraintRule(long ruleId, NodeKeyConstraintDescriptor descriptor, long indexId)
 {
     return(ConstraintRule.constraintRule(ruleId, descriptor, indexId));
 }