ABSTRACT


Info on testing your integration using the development utility and some examples.


Testing


Inside of your integration.Template add a new file to the interface folder named... “DevelopmentTests.cs”


Inside of this file create examples of the interactions discussed in the data activity.


These example functions should run and have slight explanations in them documented by the creator.



Some things to NOTE...


All Tests must be redone should a new feature be added to ensure all is well and all supported functions still work.


If the data activity states a direction in relation to IPaaS.com depending on direction some things must be shown in the test.


If TO IPaas.com- The data in the portal must be shown in the portal with a before and after the data is transferred.


If FROM IPaaS.com- In a similar manner the success of the data movement must be shown with a successful test and the presence of the data.


Each field described/needed for the aforementioned data activity supported Mapping Collections| Directions| Functions should have a Mapping in the template subscription.



Each test function is dependent on the intention of the integration and for each supported function a new test should be made. E.G. (If an integration wishes to work with the CUSTOMER mapping collection and chooses to go in one direction being FROM IPaaS.com. However, with this collection, the data can be created as new or be updated. In this case two test functions need to be created one to show the creation of a new CUSTOMER and one for the updating of a CUSTOMER with data moving from IPaaS.com).



FOR EXAMPLE.


Below is a single test function that would be found in the DevelopmentTests.cs file in this case this function is FROM IPaaS.com to an integration for Philips Hue Light. This function is only to turn on the light.


As shown for each function also present within whatever is needed to make the function work should also be an example of what is takes to verify such info and the verified info.

( in this case "on": true,)


In order to run this in the development utility for example will look like this:


TEST MeetHue_Transaction_FromiPaaS_Update 301


// Development Test Structure

        public static async Task MeetHue_Transaction_FromiPaaS(Integration.Abstract.Connection connection)

        {

            // Below is a Test Scenario to turn on a Phillips Hue Light named               //"Mood Light"

            var conn = (Connection)connection;

            var wrapper = conn.CallWrapper;

            // Development Tests should start with datamodels that were //registered in Interface.Metadata

            // Each field in the Template mappings for this integration should //be represented below.

            DataModels.HueAction TestLightAction = new DataModels.HueAction();

            // Highlights of the test

            // 1) Demonstrate how a Built-In Conversion function can be //applied in the mappings

            TestLightAction.EventType = DataModels.EventType.Light;

            TestLightAction.SearchName = "Mood Light";

            TestLightAction.LightState = ConversionFunctions.FlashRed();

            await TestLightAction.Update(wrapper);

//COMMENTS ON VERIFICATION OF THIS FUNCTION

            // Describe the expected outcome and how it can be evidenced

            // The light on my Hue Account named "Mood Light" will have a changed lightstate. 

            // This can be evidenced by camera or by accessing the MeetHue API using the subscription credentials directly.

            // https://api.meethue.com/bridge/{{bridge}}/lights

            //"3": {

            //    "state": {

            //        "on": true,

            //        "bri": 254,

            //        "hue": 63252,

            //        "sat": 249,

            //        "effect": "none",

            //        "xy": [

            //            0.6616,

            //            0.2828

            //                ],

            //        "alert": "lselect",

            //        "colormode": "hs",

            //        "mode": "homeautomation",

            //        "reachable": true

            //            },

            //    "swupdate": {

            //                "state": "noupdates",

            //        "lastinstall": "2021-10-22T18:36:44"

            //    },

            //    "type": "Color light",

            //    "name": "Mood Light",

            //    "modelid": "LLC011",

            //    "manufacturername": "Signify Netherlands B.V.",

            //    "productname": "Hue bloom",

            //    "capabilities": {

            //                "certified": true,

            //        "control": {

            //                    "mindimlevel": 10000,

            //            "maxlumen": 120,

            //            "colorgamuttype": "A",

            //            "colorgamut": [

            //                [

            //                    0.704,

            //                    0.296

            //                ],

            //                [

            //                    0.2151,

            //                    0.7106

            //                ],

            //                [

            //                    0.138,

            //                    0.08

            //                ]

            //            ]

            //        },

            //        "streaming": {

            //                    "renderer": true,

            //            "proxy": false

            //        }

            //            },

            //    "config": {

            //                "archetype": "huebloom",

            //        "function": "decorative",

            //        "direction": "upwards",

            //        "startup": {

            //                    "mode": "custom",

            //            "configured": true,

            //            "customsettings": {

            //                        "bri": 254,

            //                "xy": [

            //                    0.202,

            //                    0.5619

            //                ]

            //            }

            //                }

            //            },

            //    "uniqueid": "00:17:88:01:00:1c:76:4a-0b",

            //    "swversion": "67.91.1"

            //}

        }