I have an OLE COM object that trying to write a wrapper for, I have decided to start to use TDD to write the code for it as I believe that it will give me a better sense of direction with what I'm try to write. The COM object has a interface like this:
Interface Mapinfo
Sub [Do](ByVal cmd As String)
Function Eval(ByVal cmd As String) As String
End Interface
The [Do] command would take somthing like the following
Mapinfo.Do("OpenTable("""C:\Temp\MyTable.TAB""")")
Now I am trying to write a wrapper so there is a function like this:
Mapinfo.OpenTable("C:\Temp\MyTable.TAB")
Now my main problem that I'm having, is that every time I want to write a new test and some code I have to create an instance of the OLE object,wait for the application to start(30 secs+), test my little function,close and dispose OLE object, change code and run it all again.
My question is: Is there a better way to do all of this with out having to start the OLE app every time? I have heard about mock objects but haven't really looked into it much, would they help me here? If so how?
EDIT: I have now realized that I will have to make a mock object for Mapinfo, my question is how do I make a make a mock object that can take different formated strings? How will this help me verify that the code in my wrapper is correct?