public async Task ListLocationsItems_Success() { var payload = "{\r\n \"Method\": \"locations.listitems\",\r\n \"Params\": [\r\n {\r\n \"Locations\": [\r\n {\r\n \"Uuid\": \"b4e948b8-6378-498f-961c-b7c285c9f5b8\"\r\n },\r\n {\r\n \"Uuid\": \"7f62f934-83d3-4c66-b4bd-df7065cb1c6a\"\r\n }\r\n ]\r\n }"; _nativeMqttClient.Setup(d => d.PublishMessage(It.IsAny <Request>(), It.IsAny <CancellationToken>())) .ReturnsAsync(new PublishResult(PublishResultCode.Success), TimeSpan.FromSeconds(1)); var response = await _client.GetLocationItems(new List <string> { "b4e948b8-6378-498f-961c-b7c285c9f5b8", "7f62f934-83d3-4c66-b4bd-df7065cb1c6a" }); response.IsSuccess.Should().BeTrue(); _nativeMqttClient.Verify(d => d.PublishMessage(It.Is <Request>(d => d.Payload == payload), It.IsAny <CancellationToken>()), Times.Once); }