Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void stringWithMaximumLengthShouldBeAllowed()
        internal virtual void StringWithMaximumLengthShouldBeAllowed()
        {
            string   longestString = RandomStringUtils.randomAscii(IndexWriter.MAX_TERM_LENGTH);
            Document document      = documentRepresentingProperties(( long )123, longestString);

            assertEquals(longestString, document.getField(string.key(0)).stringValue());
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void createDropRelationshipLongStringProperty()
        public virtual void CreateDropRelationshipLongStringProperty()
        {
            Label  markerLabel     = Label.label("marker");
            string testPropertyKey = "testProperty";
            string propertyValue   = RandomStringUtils.randomAscii(255);

            using (Transaction tx = Db.beginTx())
            {
                Node         start        = Db.createNode(markerLabel);
                Node         end          = Db.createNode(markerLabel);
                Relationship relationship = start.CreateRelationshipTo(end, withName("type"));
                relationship.SetProperty(testPropertyKey, propertyValue);
                tx.Success();
            }

            using (Transaction tx = Db.beginTx())
            {
                Relationship relationship = Db.getRelationshipById(0);
                assertEquals(propertyValue, relationship.GetProperty(testPropertyKey));
                tx.Success();
            }

            using (Transaction tx = Db.beginTx())
            {
                Relationship relationship = Db.getRelationshipById(0);
                relationship.RemoveProperty(testPropertyKey);
                tx.Success();
            }

            using (Transaction tx = Db.beginTx())
            {
                Relationship relationship = Db.getRelationshipById(0);
                assertFalse(relationship.HasProperty(testPropertyKey));
                tx.Success();
            }
        }