unit testing for complex object