//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")));
            }
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldPerformStringContainsSearch() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldPerformStringContainsSearch()
        {
            // given
            ISet <Pair <long, Value> > expected = new HashSet <Pair <long, Value> >();

            using (Transaction tx = beginTransaction())
            {
                expected.Add(NodeWithProp(tx, "gnomebat"));
                NodeWithPropId(tx, "fishwombat");
                tx.Success();
            }

            CreateIndex();

            // when
            using (Transaction tx = beginTransaction())
            {
                int label = tx.TokenRead().nodeLabel("Node");
                int prop  = tx.TokenRead().propertyKey("prop");
                expected.Add(NodeWithProp(tx, "homeopatic"));
                NodeWithPropId(tx, "telephonecompany");
                IndexReference index = tx.SchemaRead().index(label, prop);

                AssertNodeAndValueForSeek(expected, tx, index, NeedsValues, "immense", IndexQuery.StringContains(prop, stringValue("me")));
            }
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testExact_ComparingBigDoublesAndLongs()
        public virtual void TestExactComparingBigDoublesAndLongs()
        {
            ExactPredicate p = IndexQuery.Exact(_propId, 9007199254740993L);

            assertFalse(Test(p, 9007199254740992D));
        }
Esempio n. 4
0
 private bool Test(IndexQuery p, object x)
 {
     return(p.AcceptsValue(x is Value ? ( Value )x : Values.of(x)));
 }
Esempio n. 5
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);
        }
Esempio n. 6
0
        // STRING CONTAINS

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStringContains_FalseForIrrelevant()
        public virtual void TestStringContainsFalseForIrrelevant()
        {
            StringContainsPredicate p = IndexQuery.StringContains(_propId, stringValue("cat"));

            AssertFalseForOtherThings(p);
        }