コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldDropSchemaRuleFromStore() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldDropSchemaRuleFromStore()
        {
            // GIVEN
            SchemaRecord beforeRecords = Serialize(_rule, _id, true, true);
            SchemaRecord afterRecords  = Serialize(_rule, _id, false, false);

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

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

            // THEN
            verify(_schemaStore).updateRecord(Iterables.first(afterRecords));
        }
コード例 #2
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;
        }