Author Topic: The Unit tests additionally to the Integrate tests  (Read 1289 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
The Unit tests additionally to the Integrate tests
« on: April 11, 2016, 06:16:19 PM »
It is possible to write integrating tests for AutoCAD .NET extensions through the Gallio and NUnit frameworks. But they can't be used for the unit tests writing (for AutoCAD). Have anybody experience of unit tests writing for AutoCAD through using other framework platforms (JustMock, TypeMock, etc)? If such developer is exists, then his impression about this experience would be interesting to me. 

For me it seems very difficult to write such tests because it is necessary to write a lot of the mocks and stubs. Thus creation of the unit test requires necessary knowledge of the internal content of the tested code. It breaks encapsulation and can promote a brittleness of the test (in my opinion).

It is interesting to me whether costs of creation of the unit tests for AutoCAD, in addition to integration tests pay off.   
« Last Edit: April 12, 2016, 10:58:57 AM by Andrey Bushman »

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: The Unit tests additionally to the Integrate tests
« Reply #1 on: April 12, 2016, 07:10:11 AM »
I spent more time mocking AutoCAD (pun intended) than actually getting any work done. You would also need to be 100% sure your mocks and stubs mimicked AutoCAD perfectly for them to be valid tests. This is why I gave up on pure unit-testing AutoCAD interactions. By its very nature, testing your code for the AutoCAD API is integration testing. You really do need to allow for AutoCAD's behavior (and BUGS) because that is how your production code will run. You can still follow Arrange, Act, Asset methodologies.

Just my opinion.