using DeviceInfoToAliIotHubViaGateway; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using System; using System.Collections.Generic; using static DeviceInfoToAliIotHubViaGateway.App; namespace DeviceInfoToAliIotHubViaGatewayTest { [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { List> list = new List>() { new KeyValuePair("p1","v1"), }; var vv = list.WrapToPropertiesChangedInLocalJson(12); } [TestMethod] public void TestMethod2() { List> list = new List>() { new KeyValuePair("p1",222), }; var vv = list.WrapToPropertiesChangedInLocalJson(12); } [TestMethod] public void TestMethod6() { List> list = new List>() { new KeyValuePair("p1","v1"), new KeyValuePair("p2","v2"), }; var vv = list.WrapToPropertiesChangedInLocalJson(12); } [TestMethod] public void TestMethod8() { List> list = new List>() { new KeyValuePair("p1","v1"), new KeyValuePair("p2",2), new KeyValuePair("p4","v4"), }; var vv = list.WrapToPropertiesChangedInLocalJson(12); } [TestMethod] public void JsonSerializeTestMethod0() { //Alink_PropertyChanging_FromLocal request = new Alink_PropertyChanging_FromLocal() { id = "123" }; //request.Params = new Dictionary() { // { "p1", "v1" }, // { "p2", 9999 }, // { "p3", new DynamicDevice2TupleParam(){ // deviceName = "myName", productKey = "myKey" } } }; //var result = JsonConvert.SerializeObject(request, // new JsonSerializerSettings() { ContractResolver = new AliIotHubJsonFormatResolver() }); } } }