예제 #1
0
        public async Task TempSensor()
        {
            var tempSensorModule    = TempSensorModule.GetInstance();
            CancellationToken token = this.TestToken;

            EdgeDeployment deployment = await this.runtime.DeployConfigurationAsync(
                builder =>
            {
                builder.AddModule(tempSensorModule.Name, tempSensorModule.Image)
                .WithEnvironment(new[] { ("MessageCount", "1") });
예제 #2
0
        public async Task TempFilter()
        {
            string filterImage = Context.Current.TempFilterImage.Expect(() => new ArgumentException("tempFilterImage parameter is required for TempFilter test"));

            const string filterModuleName = "tempFilter";
            var          tempSensorModule = TempSensorModule.GetInstance();

            CancellationToken token = this.TestToken;

            EdgeDeployment deployment = await this.runtime.DeployConfigurationAsync(
                builder =>
            {
                builder.AddModule(tempSensorModule.Name, tempSensorModule.Image);
                builder.AddModule(filterModuleName, filterImage)
                .WithEnvironment(new[] { ("TemperatureThreshold", "19") });
예제 #3
0
        public async Task TempSensor()
        {
            var tempSensorModule    = TempSensorModule.GetInstance();
            CancellationToken token = this.TestToken;

            EdgeDeployment deployment = await this.runtime.DeployConfigurationAsync(
                builder => { builder.AddModule(tempSensorModule.Name, tempSensorModule.Image); },
                token);

            EdgeModule sensor = deployment.Modules[tempSensorModule.Name];
            await sensor.WaitForEventsReceivedAsync(deployment.StartTime, token);

            await sensor.UpdateDesiredPropertiesAsync(
                new
            {
                properties = new
                {
                    desired = new
                    {
                        SendData     = true,
                        SendInterval = 10
                    }
                }
            },
                token);

            await sensor.WaitForReportedPropertyUpdatesAsync(
                new
            {
                properties = new
                {
                    reported = new
                    {
                        SendData     = true,
                        SendInterval = 10
                    }
                }
            },
                token);
        }