Though you can create the table rows for the various objects like that, it might actually be better to use the processors for this purpose, e.g.
<?php
$_GET['key'] = 'unittest';
$_GET['description'] = 'The unit test context for context settings.';
$result = $modx->executeProcessor(array('action' => 'context/create'));
?>
The processors provide a central location for consistent business logic to be used when the important core Revolution objects are being created. They provide validation, error messages that are localizable, call the core events that plugins are attached to, and more.
There are certainly cases, where this is not the right solution, and you may want to manipulate the objects manually in your own process as cipa suggested.