Unit testing with autocad

Unit testing with autocad

Anonymous
Not applicable
2,032 Views
5 Replies
Message 1 of 6

Unit testing with autocad

Anonymous
Not applicable
Hi,

how can i make unit test(with nunit, or other unit test framework)
with autocad? Is it possible?
0 Likes
2,033 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
This message was cancelled from within Mozilla.
0 Likes
Message 3 of 6

Anonymous
Not applicable
I'm searching for more resources on this also.... Time prohibits me from trying stuff out myself, but I have found some directions:


As I have posted on Keans blog: [http://through-the-interface.typepad.com/through_the_interface/2008/11/adding-a-custom.html?cid=143409992#comments|link]

A tool exists, Gallio that (among many other features) runs MbUnit tests in the AutoCAD context.
I have not yet had the time to look into it, but it seems interesting. The documentation on AutoCAD integration is scarce though, so trying it out is the only way to go right now.

Another option, from my point of view, 'Contracting' all your functionality. This means writing interfaces for the self-written functionality, and mocking it in the unit tests.

This way you don't need to use the acad dll's, but it does create a LOT of overhead for your code. It means proxying all acad-functionality you need, again in your own code.

If anyone has any other options (or links), please share... Edited by: bertvan on Dec 24, 2008 10:38 AM
0 Likes
Message 4 of 6

Anonymous
Not applicable
Hi,

I've played with Gallio some more, and the Unit testing inside the AutoCAD process works great.
The major pitfall of working this way is in my opinion the lack of possibility of combining NCover with the Unit tests...

I'v posted a question concerning this on their google group: http://groups.google.com/group/gallio-dev/browse_thread/thread/509366641eca5f0?hl=en

It seems this functionality won't be around soon...

I do remember playing around with the unit testing in Visual studio, and there it did work if I set the path correctly. The downfall here is that for every test session, Visual Studio copied all the needed dll's (about the entire installation dir) for every test. Which was pretty lengthy...

So, any extra light (from Autodesk 😉 would be welcome, because for now it seems as I'm just talking to myself 🙂
0 Likes
Message 5 of 6

Anonymous
Not applicable
Hey, I'd love to hear updates...I for one am getting started trying to use Gallio with AutoCAD. I appreciate the posts.
0 Likes
Message 6 of 6

Anonymous
Not applicable
Hi,

I have succesfully implemented this at the moment. However not with using Galllio, but by using IoC (Windsor, but you could also use home-written factories).

Gallio seemed too cumbersome, and did not allow us to extend this with Coverage etc.I wanted fast execution of the tests.

So we created some sort of extra framework, wich can be mocked, and we can unit test against that without any problems.

To perform unit tests on the code that actually calls the acad API, you will need something like Gallio. In the future we still might test the lowest level code of our framework with Gallio.

--

http://cupocadnet.blogspot.com
0 Likes