[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

Mock object...

Hi experts,

    Does anyone know if I can cast a mock object to another class ? If so, how to do that ? thanks.
0
meow00
Asked:
meow00
  • 2
2 Solutions
 
objectsCommented:
wouldn't think so, would be more a case of casting whatever it is proxying.
what sort of mock objects are you using?
0
 
Manikandan ThiagarajanSenior consultantCommented:
0
 
objectsCommented:
For example if using jmock you would cast the object returned by proxy() method to whatever class it is you are mocking.
0
 
sciuriwareCommented:
Most mocking uses interfaces for this reason.
Your reference should be to that interface.

There are some mocking frameworks that work on classes, but they're limited in functionality.

;JOOP!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now