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 128193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:35:47+00:00 2026-05-11T05:35:47+00:00

We are developing applications for use within AutoCAD. Basically we create a Class Library

  • 0

We are developing applications for use within AutoCAD. Basically we create a Class Library Project, and load the .dll in AutoCAD with a command (NETLOAD).

As so, we can use commands, "palettes", user controls, forms etc…

AutoDesk provides an API through some dll’s, running in their program directory. When referencing these dll’s you can only call the dll’s at runtime while loading your app in AutoCAD (This is a licensing security from AutoDesk).

For us, while developing, this is not a problem, we need to visually test within the context of AutoCAD, so we just set the Debug Properties so that they start acad.exe and load our dll with a script in the acad.exe parameters.

The problem is, when trying to unit test our code, NUnit or mstest are not running from within the AutoCAD context and they also cannot start it. There exist a tool called Gallio, which has provided an interface with AutoCAD, so that it can run Unit test through IPC with Named Pipes.

However, this solution is, for me, too much of a hassle. I want to be able to quickly write tests without having to leave my beloved IDE.

So, what, from a "good design view" would be a good approach to this problem? I’m thinking I would basically need a testable codebase which is not referencing the AutoCAD dll’s and a non-testable that does references the untestable AutoCAD dll’s.

I’m sure there are ways to get this to work: ( IOC, DI, Adapter Pattern,. .) I just don’t these principles in depth and thus I don’t know which route will best suit my purposes and goals.

  • 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-11T05:35:48+00:00Added an answer on May 11, 2026 at 5:35 am

    The first step is to triage your code for parts which need AutoCAD and parts which are really independent. Create unit tests for the independent parts as you usually would.

    For the other parts, you need mockups which behave like AutoCAD. Make them as simple as possible (for example, just return the correct answers in the methods without doing any calculations). Now, you need several sets of classes:

    1. A set of interfaces which your code uses to achieve something (for example, load a drawing).

    2. A set of implementations for said set of interfaces which call the AutoCAD dlls.

    3. A set of classes which try the implementations within the context of AutoCAD. Just create a small UI with a couple of buttons where you can run this code. It is used to reassure yourself that your mockups do the right thing. Log method parameters and results to some file so you can try how AutoCAD responds. If a mockup breaks, you can use this code to verify what AutoCAD is doing and you can use it as a reference when developing the mockups.

    4. When you know how AutoCAD responds, create the mockups. In your tests, create them with the desired results (and errors, so you can test error handling, too). So when you have boolean loadDrawing(File filename), create a mockup which returns true for the filename exists.dxf and false for anything else.

    5. Use a factory or DI to tell your application code which implementation to use. I tend to have a big global config class with a lot of public fields where I simply store the objects to use. I can set this up in the beginning, it’s fast, it’s easy to understand. If you need to create objects at runtime, then put factories in the config class which generate the objects for you, so you can swap them out.

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

Sidebar

Ask A Question

Stats

  • Questions 102k
  • Answers 102k
  • 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 It depends, I think, how much UI you require. The… May 11, 2026 at 8:16 pm
  • Editorial Team
    Editorial Team added an answer For a hex-editor, there is no nead to read the… May 11, 2026 at 8:16 pm
  • Editorial Team
    Editorial Team added an answer I normally use the smallest non-widescreen resolution I can and… May 11, 2026 at 8:16 pm

Related Questions

We are busy developing a Java web service for a client. There are two
I am developing an auto-builder that will run a series of steps in our
Background: At my company we are developing a bunch applications that are using the
We are developing a considerably big application using Ruby on Rails framework (CRM system)

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.