Beispiel #1
0
 public override void ClearGraph()
 {
     GraphDatabaseServiceCleaner.cleanDatabaseContent(_db);
     using (Transaction tx = _db.beginTx())
     {
         PropertyContainer graphProperties = graphProperties();
         foreach (string key in graphProperties.PropertyKeys)
         {
             graphProperties.RemoveProperty(key);
         }
         tx.Success();
     }
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void creatingAndDeletingEntitiesShouldNotThrow()
        public virtual void CreatingAndDeletingEntitiesShouldNotThrow()
        {
            // Given
            GraphDatabaseService dataBase = DbRule.GraphDatabaseAPI;
            Node myNode;

            // When
            using (Transaction bobTransaction = dataBase.BeginTx())
            {
                myNode = dataBase.CreateNode();
                myNode.SetProperty("Name", "Bob");

                myNode.CreateRelationshipTo(dataBase.CreateNode(), RelTypes.Asd);
                bobTransaction.Success();
            }

            // When
            GraphDatabaseServiceCleaner.cleanupAllRelationshipsAndNodes(dataBase);
        }