示例#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 shouldDropSchemaRuleFromIndex() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldDropSchemaRuleFromIndex()
        {
            // GIVEN
            SchemaRecord beforeRecords = Serialize(_rule, _id, true, true);
            SchemaRecord afterRecords  = Serialize(_rule, _id, false, false);

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

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

            // THEN
            verify(_indexes).dropIndex(_rule);
        }
示例#3
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;
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRecreateSchemaRuleWhenDeleteCommandReadFromDisk() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRecreateSchemaRuleWhenDeleteCommandReadFromDisk()
        {
            // GIVEN
            SchemaRecord beforeRecords = Serialize(_rule, _id, true, true);
            SchemaRecord afterRecords  = Serialize(_rule, _id, false, false);

            Command.SchemaRuleCommand command = new Command.SchemaRuleCommand(beforeRecords, afterRecords, _rule);
            InMemoryClosableChannel   buffer  = new InMemoryClosableChannel();

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

            // WHEN
            command.Serialize(buffer);
            Command readCommand = _reader.read(buffer);

            // THEN
            assertThat(readCommand, instanceOf(typeof(Command.SchemaRuleCommand)));

            AssertSchemaRule((Command.SchemaRuleCommand)readCommand);
        }