Author Topic: Test Driven Development of EA Extensions  (Read 2607 times)

kotrick

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Test Driven Development of EA Extensions
« on: March 11, 2015, 11:10:28 pm »
Hello,

We have developed many plug-in's for Enterprise Architect and we are interested to do this activity in TestDriven Development.

We are developing plug-ins using visual c#(Visual studio 2010)

I want to write test cases for these add-ins.But have below issue:

How to get the repository object and start running test cases?
Can anyone please suggest or help me to identify solution for testing EA add-ins

Thanks in advance

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Test Driven Development of EA Extensions
« Reply #1 on: March 11, 2015, 11:17:59 pm »
Code for C++:

Code: [Select]
CLSID clsid;
CLSIDFromProgID(L"EA.App", &clsid);
IUnknown *pUnk = NULL;
IDispatch *pDisp = NULL;
HRESULT hr = GetActiveObject(clsid, NULL, (IUnknown**)&pUnk);
if(SUCCEEDED(hr)) {
  hr = pUnk->QueryInterface(IID_IDispatch, (void **)&pDisp);
}

(from my Scripting book)

q.