added unit tests for creating documents