<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Writing Unit Tests for Custom Commands in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/writing-unit-tests-for-custom-commands/m-p/9007207#M31046</link>
    <description>&lt;P&gt;&lt;A href="https://github.com/CADbloke/CADtest" target="_blank"&gt;https://github.com/CADbloke/CADtest&lt;/A&gt;&amp;nbsp;runs NUnit inside AutoCAD.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Sep 2019 06:29:18 GMT</pubDate>
    <dc:creator>CADbloke</dc:creator>
    <dc:date>2019-09-05T06:29:18Z</dc:date>
    <item>
      <title>Writing Unit Tests for Custom Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/writing-unit-tests-for-custom-commands/m-p/7141627#M31044</link>
      <description>&lt;P&gt;I wondered if anyone has any thoughts on how we can write unit test for AutoCAD command that we write for a plugin.&lt;BR /&gt;&lt;BR /&gt;Currently I just run up in debug, try my command and see that it does what I expect it should.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;has anyone ever written unit tests for their commands.&amp;nbsp; How did you get round dependency on AutoCAD objects?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just looking to see if this is possible.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 16:37:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/writing-unit-tests-for-custom-commands/m-p/7141627#M31044</guid>
      <dc:creator>oneMSN</dc:creator>
      <dc:date>2017-06-09T16:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Writing Unit Tests for Custom Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/writing-unit-tests-for-custom-commands/m-p/7144852#M31045</link>
      <description>&lt;P&gt;Please look at this &lt;A href="https://forums.autodesk.com/t5/net/unit-testing-with-autocad/td-p/1739616" target="_self"&gt;post&lt;/A&gt;&amp;nbsp;for integration tests. The development of the Gallio AutoCAD extension&amp;nbsp;seems to be stopped at AutoCAD 2013, so you'll have to make an upgrade yourself. The source code can be found here:&amp;nbsp;&lt;A href="https://github.com/Gallio/mbunit-v3/tree/master/src/Extensions/AutoCAD" target="_blank"&gt;https://github.com/Gallio/mbunit-v3/tree/master/src/Extensions/AutoCAD&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can run some unit tests by setting your project output path to the installation directory of AutoCAD, but this approach is very limited and not very clean because you will pollute your AutoCAD installation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best approach is to find a way to integrate a test runner in AutoCAD. You can write your own runner/test framework like this one for Revit:&amp;nbsp;&lt;A href="https://github.com/DynamoDS/RevitTestFramework" target="_blank"&gt;https://github.com/DynamoDS/RevitTestFramework&lt;/A&gt; or use an existing framework like NUnit and make the test runner work in AutoCAD like this project, also for Revit:&amp;nbsp;&lt;A href="https://github.com/ArupAus/RvtUnit" target="_blank"&gt;https://github.com/ArupAus/RvtUnit&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not an easy task as you can see. And you need to start AutoCAD each time you want to run the test (you can speed up the process if you use AutoCAD Core Console however).&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 07:10:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/writing-unit-tests-for-custom-commands/m-p/7144852#M31045</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2017-06-12T07:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Writing Unit Tests for Custom Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/writing-unit-tests-for-custom-commands/m-p/9007207#M31046</link>
      <description>&lt;P&gt;&lt;A href="https://github.com/CADbloke/CADtest" target="_blank"&gt;https://github.com/CADbloke/CADtest&lt;/A&gt;&amp;nbsp;runs NUnit inside AutoCAD.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 06:29:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/writing-unit-tests-for-custom-commands/m-p/9007207#M31046</guid>
      <dc:creator>CADbloke</dc:creator>
      <dc:date>2019-09-05T06:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Writing Unit Tests for Custom Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/writing-unit-tests-for-custom-commands/m-p/13426299#M31047</link>
      <description>&lt;P&gt;Shameless plug, &lt;A href="https://civilwhiz.com/docs/autocad-civil-3d-plugin-unit-test-with-nunit/" target="_blank" rel="noopener"&gt;I've written a detailed post&lt;/A&gt; on how I get NUnit to run with Civil 3D/AutoCAD, based on&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/510537"&gt;@CADbloke&lt;/a&gt;&amp;nbsp;very helpful guide.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 05:24:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/writing-unit-tests-for-custom-commands/m-p/13426299#M31047</guid>
      <dc:creator>soonhui</dc:creator>
      <dc:date>2025-04-15T05:24:53Z</dc:date>
    </item>
  </channel>
</rss>

