Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

Close
Important Announcement: WELCOME to the Schneider Electric Community! We have moved to a new address: community.se.com — bookmark it today and contact SchneiderCommunity.Support@se.com if you have any questions!
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
82691members
350410posts

Testing Execute_SubClass()

SmartConnector Forum

Discussion of SmartConnector applications for integration of various other building management systems (BMS) into EcoStruxure Building Operation

Solved
KarimHussain
Commander Commander
Commander
0 Likes
1
179

Testing Execute_SubClass()

Hello. 

 

Is it possible to test Execute_SubClass() of a processor?

 

Validating configuration was easy but I can't figure out how to trigger an execution of Execute_SubClass()...

 

Any suggestions? 


Accepted Solutions
Nick-Iebba
Schneider Alumni (Retired)
Schneider Alumni (Retired)

Re: Testing Execute_SubClass()

Yes it is, via Unit Testing.

 

Usually in a Smart Connector extension, there are at least two projects: the extension and the test project. What you would need to do to start:

1. Download a Test Runner, an external app or Visual Studio add-in that will let you test this code as it executes. If you already have something called ReSharper installed, then you have this.

   a. From Visual Studio, Tools --> Extensions and Updates

   b. Select "Online - Visual Studio Gallery"

   c. In the Search field, type "NUnit" (this is the recommened one)

   d. Download and Install NUnit Test Adapter 3

2. Install the Smart Connector Runtime. You can find out how to do this in Section 4 of the Smart Connector Installation and Configuration Guide, let me know if you don't have that

3.  Add a new Class Library project to your Solution and preferably name it "[extensionName].Test"

4. Create your Unit Testing project. This is covering in Chapter 9 of the "Smart Connector Developer - Video Series" series on MyLearningLink. If you do not have access to that, tell me and I can link you to the series hosted on Teachable.com. It is a video adaptation of the Smart Connector Developer's Guide.

 

The material I mentioned in Step 4 will go over coding Unit tests and several other subtleties about the tests. There are three types that you will eventually set up: the one you want to run to test Execute_Sublcass is the ExecuteTest.

See Answer In Context

1 Reply 1
Nick-Iebba
Schneider Alumni (Retired)
Schneider Alumni (Retired)

Re: Testing Execute_SubClass()

Yes it is, via Unit Testing.

 

Usually in a Smart Connector extension, there are at least two projects: the extension and the test project. What you would need to do to start:

1. Download a Test Runner, an external app or Visual Studio add-in that will let you test this code as it executes. If you already have something called ReSharper installed, then you have this.

   a. From Visual Studio, Tools --> Extensions and Updates

   b. Select "Online - Visual Studio Gallery"

   c. In the Search field, type "NUnit" (this is the recommened one)

   d. Download and Install NUnit Test Adapter 3

2. Install the Smart Connector Runtime. You can find out how to do this in Section 4 of the Smart Connector Installation and Configuration Guide, let me know if you don't have that

3.  Add a new Class Library project to your Solution and preferably name it "[extensionName].Test"

4. Create your Unit Testing project. This is covering in Chapter 9 of the "Smart Connector Developer - Video Series" series on MyLearningLink. If you do not have access to that, tell me and I can link you to the series hosted on Teachable.com. It is a video adaptation of the Smart Connector Developer's Guide.

 

The material I mentioned in Step 4 will go over coding Unit tests and several other subtleties about the tests. There are three types that you will eventually set up: the one you want to run to test Execute_Sublcass is the ExecuteTest.