I am not the only one who has seen, or posted, forum threads asking for help when it comes to testing your plugin in an automated way. Whether it be unit or integration testing, the desired result is still the desire to apply TDD when developing a .NET plugin for AutoCAD. As someone who has made one of these posts, I feel it is coming from a place of someone who is new to software development and doesn't know where to start with TDD. And then comes to find that there is an extra layer of difficulty in depending on AutoCAD to run your tests.
Now I have read Scott MacFarlane's Automated Testing with the AutoCAD .NET API
https://forums.autodesk.com/autodesk/attachments/autodesk/152/51134/1/handout_2654_CP2654_Automated_Testing.docxAnd while it was helpful it is also very out of date, relaying on Gallio which doesn't appear to have been updated in quiet some time.
I have also began using CADBloke's CADTest project in my own for testing
https://github.com/CADbloke/CADtestThis is a great tool, though I've run into difficult a few times with it. But it is simply a tool, and in the hands of an inexperienced developer can only do so much.
I usually think in examples so I'll use a personal one that I think might be a good demonstration. Thankfully this tool has already been developed, but I'm now maintaining it:
Say we want a tool to array out lines to represent joists on a floor plan. The tool asks for a closed polyline, then a joist spacing amount, and an orientation the joists are ment to go (ie EW or NS). I could see manually running a test where I have a closed polyline ready, I input the spacing I know I'm testing for, and the orientation I'm testing for, and then can visually inspect if it worked. But how could this be done with automation?
I could record the handle of the closed polyline and then run a test where that gets fed into the tool, and do the same for the other pieces of information. But how could I verify it worked without visually inspecting it?
I think this is just one example of the difficulty many are trying to over come. I see many posts where people ask how to unit test their plugin and are met with either people saying it's not very feasible, or simply linking one of the above links I've already provided.
I guess I'm just hoping to create a place where people can hopefully get some answers when they Google "AutoCAD Unit Testing".
Thanks for any help, and for reading my rant!