I have a protocol
protocol SomeProtocol { func method() }
and its implementation
extension SomeProtocol {func method(){--implementation--}}
In build target i have a class confirming to this protocol
class SomeClass: SomeProtocol { func doSomething() { method() } }
What i want is i want to have a different implementation of the protocol method in my test target, in my XCTest file. For that what i did was i extended the SomeClass and wrote my implementation there.
extension SomeClass {func method(){--other implementation--} }
But it never got called while executing test cases. Always the method in build target, the default implementation, was getting called.
Please advice what i should be doing.