Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 71813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:56:48+00:00 2026-05-10T19:56:48+00:00

I have an OLE COM object that trying to write a wrapper for, I

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:56:49+00:00Added an answer on May 10, 2026 at 7:56 pm

    Yes, mock objects would help. Essentially, you create a fake Mapinfo object by mocking the Mapinfo interface (you should rename that IMapInfo, btw).

    You then instruct that mock what calls to expect, and what results to return (if appropriate). You can also create tests where the mock throws exceptions or does other things that are hard to invoke using the real object.

    The two big (and free) .NET mocking frameworks are MoQ and Rhino Mocks. Rhino is more mature and has more ways of configuring mocks. MoQ is the newcomer and has a smaller featureset and less ways of setting expectations than Rhino.

    Personally, I think MoQ is better for the newcomer to mocking. Its relatively easy to understand, all the documentation out there is relevant to the current release (search for Rhino tutorials and you get junk from years ago that doesn’t apply anymore), and it performs well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 142k
  • Answers 142k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try the Novell LDAP library. (Guide article here) May 12, 2026 at 8:12 am
  • Editorial Team
    Editorial Team added an answer No, if you are using the SharePoint Object Model and… May 12, 2026 at 8:12 am
  • Editorial Team
    Editorial Team added an answer Each language folder should implement INavigationRoot. You can set that… May 12, 2026 at 8:12 am

Related Questions

I have been trying to read a picture saved in Access DB as a
I am trying to send some data from a LINQ query in C# to
I suspect that I will shortly have a need to write an integration library
Are there any inherent problems with calling an ole object from tsql? I have

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.