RulesFactory with tests