added testcase for castingfactory