public void InvokeMethod_ShouldReturnCorrectStatus(string methodName, string payload, int expectedStatusCode) { deviceClient.SetMethodHandlerAsync("SetTelemetryInterval", DeviceAppModel.SetTelemetryInterval, null).Wait(); var response = ServiceAppModel.InvokeMethod(serviceClient, "DeviceApp", methodName, payload).GetAwaiter(); Assert.Equal(expectedStatusCode, response.GetResult().Status); }
static void Main(string[] args) { Task.Delay(5000).Wait(); ServiceAppModel.InvokeMethod(serviceClient, "DeviceApp", "SetTelemetryInterval", "10").GetAwaiter(); Console.ReadKey(); }