示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStringSuffix_SomeValues()
        public virtual void TestStringSuffixSomeValues()
        {
            StringSuffixPredicate p = IndexQuery.StringSuffix(_propId, stringValue("less"));

            assertFalse(Test(p, "lesser being"));
            assertFalse(Test(p, "make less noise please..."));
            assertTrue(Test(p, "less"));
            assertTrue(Test(p, "clueless"));
            assertTrue(Test(p, "cluelessly clueless"));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldPerformStringSuffixSearch() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldPerformStringSuffixSearch()
        {
            // given
            ISet <Pair <long, Value> > expected = new HashSet <Pair <long, Value> >();

            using (Transaction tx = beginTransaction())
            {
                expected.Add(NodeWithProp(tx, "1suff"));
                NodeWithProp(tx, "pluff");
                tx.Success();
            }

            CreateIndex();

            // when
            using (Transaction tx = beginTransaction())
            {
                int label = tx.TokenRead().nodeLabel("Node");
                int prop  = tx.TokenRead().propertyKey("prop");
                expected.Add(NodeWithProp(tx, "2suff"));
                NodeWithPropId(tx, "skruff");
                IndexReference index = tx.SchemaRead().index(label, prop);
                AssertNodeAndValueForSeek(expected, tx, index, NeedsValues, "pasuff", IndexQuery.StringSuffix(prop, stringValue("suff")));
            }
        }
示例#3
0
        // STRING SUFFIX

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStringSuffix_FalseForIrrelevant()
        public virtual void TestStringSuffixFalseForIrrelevant()
        {
            StringSuffixPredicate p = IndexQuery.StringSuffix(_propId, stringValue("less"));

            AssertFalseForOtherThings(p);
        }