How to mock when test extends class

102 views
Skip to first unread message

NagRock

unread,
Jun 29, 2012, 2:32:02 AM6/29/12
to mock...@googlegroups.com
Hi,

normaly we create mock like this:

var obj:Type = nice(Type);

But my test case extends my class, so I can't use nice(MyClass) becouse object of MyClass i created by TestRunner. I need to extend MyClass cuz want to test protected methods.

Jeffrey Barrus

unread,
Jun 30, 2012, 4:30:24 PM6/30/12
to mock...@googlegroups.com
It may be a good exercise to consider why you are testing protected methods.  There are many discussions that can be found on this, here is just one
http://stackoverflow.com/questions/5601730/tdd-should-private-protected-methods-be-under-unit-test
Reply all
Reply to author
Forward
0 new messages