Skip navigation
Currently Being Moderated

Adding Unit testing to a CS Extension Project

Sep 30, 2011 4:35 AM

Tags: #creative #suite #unit_testing



I'm working on a CS extension project, and I'd like to add unit testing to the project. I see that the extension project doesn't support FlexUnit. Is there a way to add unit testing to a extension project?



  • Currently Being Moderated
    Sep 30, 2011 11:40 AM   in reply to stevoad

    You can certainly use FlexUnit. Add the libraries to your project and test away.


    What we normally do, depending on the overall project requirements, is put as much of the core/logic as we can in a library. Then we write both an Air app and an Extension that are intended to execute unit tests against that library. The Air app tests the functionality that is not dependent on a host application (PS, AI, ID...).


    Depending on your project, you may or may not be able to use an Air app for testing (CSXS calls are not supported from Air).

    Mark as:
  • Currently Being Moderated
    Feb 23, 2012 6:06 AM   in reply to Bob Stucky

    Hello Bob.


    Is it planned to handle Creative Suite Extension project in FlexUnit?




    Mark as:
  • Currently Being Moderated
    Jun 18, 2013 5:54 PM   in reply to Toto RoToTO

    Another option is to abstract the API objects into interfaces, only adding the functionality you need, and mocking those with something like mockolate to do your tests. It doesn't work for everything, but it covers a lot more than the CSEB independent stuff.


    As an example, I have IApplication, with an activeDocument getter that returns IDocument. The implementations are handled by a service locator, so my extension uses actual API objects, and my test project uses mocks - easy!

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points