Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustSelectStringForStringContainsPredicate() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustSelectStringForStringContainsPredicate()
        {
            // given
            IndexQuery.StringContainsPredicate stringContains = IndexQuery.stringContains(PROP_KEY, stringValue("abc"));

            // then
            VerifyQueryWithCorrectReader(ExpectedForStrings(), stringContains);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldComputeIndexUpdatesForRangeSeekByContainsWhenThereArePartiallyMatchingNewNodes()
            internal virtual void ShouldComputeIndexUpdatesForRangeSeekByContainsWhenThereArePartiallyMatchingNewNodes()
            {
                // GIVEN
                ReadableTransactionState state = (new TxStateBuilder()).WithAdded(40L, "Aaron").withAdded(41L, "Agatha").withAdded(42L, "Andreas").withAdded(43L, "Andrea").withAdded(44L, "Aristotle").withAdded(45L, "Barbara").withAdded(46L, "Barbarella").withAdded(47L, "Cinderella").build();

                // WHEN
                IndexQuery.StringContainsPredicate indexQuery = IndexQuery.stringContains(outerInstance.index.Schema().PropertyId, stringValue("arbar"));
                AddedAndRemoved           changes             = indexUpdatesForSuffixOrContains(state, outerInstance.index, indexQuery, IndexOrder.NONE);
                AddedWithValuesAndRemoved changesWithValues   = indexUpdatesWithValuesForSuffixOrContains(state, outerInstance.index, indexQuery, IndexOrder.NONE);

                // THEN
                outerInstance.AssertContains(changes.Added, 45L, 46L);
                outerInstance.AssertContains(changesWithValues.Added, NodeWithPropertyValues(45L, "Barbara"), NodeWithPropertyValues(46L, "Barbarella"));
            }
Example #3
0
            internal virtual void AssertRangeSeekByContainsForOrder(IndexOrder indexOrder)
            {
                // GIVEN
                ReadableTransactionState state = (new TxStateBuilder()).WithAdded(40L, "Smashing").withAdded(41L, "Bashley").withAdded(42L, "Crasch").withAdded(43L, "Mayonnaise").withAdded(44L, "Seashell").withAdded(45L, "Ton").withAdded(46L, "The Flash").withAdded(47L, "Strayhound").withAdded(48L, "Trashy").withAdded(49L, "Andromeda").build();

                // WHEN
                IndexQuery                indexQuery        = IndexQuery.stringContains(outerInstance.index.Schema().PropertyId, stringValue("ash"));
                AddedAndRemoved           changes           = indexUpdatesForSuffixOrContains(state, outerInstance.index, indexQuery, indexOrder);
                AddedWithValuesAndRemoved changesWithValues = indexUpdatesWithValuesForSuffixOrContains(state, outerInstance.index, indexQuery, indexOrder);

                NodeWithPropertyValues[] expected = new NodeWithPropertyValues[] { NodeWithPropertyValues(41L, "Bashley"), NodeWithPropertyValues(44L, "Seashell"), NodeWithPropertyValues(40L, "Smashing"), NodeWithPropertyValues(46L, "The Flash"), NodeWithPropertyValues(48L, "Trashy") };

                // THEN
                outerInstance.AssertContains(indexOrder, changes, changesWithValues, expected);
            }
Example #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldComputeIndexUpdatesForRangeSeekByContainsWhenThereAreNoMatchingNodes()
            internal virtual void ShouldComputeIndexUpdatesForRangeSeekByContainsWhenThereAreNoMatchingNodes()
            {
                // GIVEN
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.storageengine.api.txstate.ReadableTransactionState state = new TxStateBuilder().withAdded(42L, "foo").withAdded(43L, "bar").build();
                ReadableTransactionState state = (new TxStateBuilder()).WithAdded(42L, "foo").withAdded(43L, "bar").build();

                // WHEN
                IndexQuery.StringContainsPredicate indexQuery = IndexQuery.stringContains(outerInstance.index.Schema().PropertyId, stringValue("eulav"));
                AddedAndRemoved           changes             = indexUpdatesForSuffixOrContains(state, outerInstance.index, indexQuery, IndexOrder.NONE);
                AddedWithValuesAndRemoved changesWithValues   = indexUpdatesWithValuesForSuffixOrContains(state, outerInstance.index, indexQuery, IndexOrder.NONE);

                // THEN
                assertTrue(changes.Added.Empty);
                assertFalse(changesWithValues.Added.GetEnumerator().hasNext());
            }