static void Main(string[] args) { deviceClient.SetMethodHandlerAsync("SetTelemetryInterval", DeviceAppModel.SetTelemetryInterval, null).Wait(); DeviceAppModel.SendMessageAsync(deviceClient).GetAwaiter(); Console.ReadKey(); }
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); }
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); }