I am attempting to write automated tests for my projects.
I have no control over how the following code has been written and have no ability to modify this code:
Public Class IAmASignleton
Private Shared ReadOnly _Instance As ISomeInterface
Shared Sub New()
_Instance = New ConcreteVersionOfInterface()
End Sub
End Class
Is there anyway for me to overwrite/replace the instance property in this class so that I can create a test version of this interface that would be used in place of the hard coded class when I am in my Test project?
Can I use a tool to intercept the Calls to this class and insert my own?
Any other way to approach replacing the ConcreteVersionOfInterface with my own class?