Example #1
0
        static void Main(string[] args)
        {
            deviceClient.SetMethodHandlerAsync("SetTelemetryInterval", DeviceAppModel.SetTelemetryInterval, null).Wait();
            DeviceAppModel.SendMessageAsync(deviceClient).GetAwaiter();

            Console.ReadKey();
        }
Example #2
0
 public void SetTelemetryInterval_ShouldChangeTelemetryInterval(string payload, int expectedTelemetryInterval)
 {
     DeviceAppModel.telemetryInterval = 5;
     DeviceAppModel.SetTelemetryInterval(new MethodRequest(payload, Encoding.UTF8.GetBytes(payload)), null).GetAwaiter();
     Assert.Equal(expectedTelemetryInterval, DeviceAppModel.telemetryInterval);
 }
Example #3
0
        public void SetTelemetryInterval_ShouldReturnCorrectStatus(string payload, int expectedStatusCode)
        {
            var response = DeviceAppModel.SetTelemetryInterval(new MethodRequest(payload, Encoding.UTF8.GetBytes(payload)), null).GetAwaiter().GetResult();

            Assert.Equal(expectedStatusCode, response.Status);
        }