Added tests for domain factory