Exemplo n.º 1
0
        public void CreateMenuTest()
        {
            ButtonGroup bg = new ButtonGroup();
            var list = new List<Button>();
            for (int i = 1; i < 4; i++)
            {
                Button b = new Button();
                b.name = i.ToString();
                list.Add(b);
            }
            foreach (var item in list)
            {
                SingleClickButton bb = new SingleClickButton();
                bb.name = item.name;
                bb.key = "click";
                bg.button.Add(bb);
            }

            string token = AccessTokenContainer.TryGetToken("wx00f1a2e4c8da9fff", "d0cecf2fa0b11a67077a4cbeb4c127ab");
            WxJsonResult wx = CommonApi.CreateMenu(token, bg);
            Assert.IsTrue(wx != null);
        }
Exemplo n.º 2
0
 private static SingleClickButton GetSingleButtonFromJsonObject(Dictionary<string, object> objs)
 {
     var sb = new SingleClickButton()
     {
         key = objs["key"] as string,
         name = objs["name"] as string,
         type = objs["type"] as string
     };
     return sb;
 }