From: <DeS...@em...> - 2003-03-10 15:02:22
|
Herman, > Here is my question : the object i want to mock has static > methods (which connect to back-end through a stack of numerous layer ...), > and i want to isolate my test from this back-end dependency. But the problem > is that static method cannot be overriden...so how could i achieve this ??? > > Any help will be appreciated Your mock object only implements the methods from the interface that your object implements. Since you can't define static methods on an interface, you can't provide mock implementations for them. Don't forget that the object you are mocking is *not* the object under test. Please provide some code snippets if my answer doesn't cover your request. Ringo |