Exemplo n.º 1
0
        public bool DeleteMenu(IWeChatOAContext context)
        {
            IDeleteMenuApi api      = new DeleteMenuApi(context);
            var            response = api.Execute();

            return(response.errcode == 0);
        }
Exemplo n.º 2
0
        public void TestDeleteMenuApi()
        {
            IDeleteMenuApi api      = new DeleteMenuApi(context);
            var            response = api.Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual(0, response.errcode);
        }
Exemplo n.º 3
0
        public void TestGetMenuApi()
        {
            ICreateMenuApi api           = new CreateMenuApi(context);
            var            jsonContainer = new CreateMenuApiJsonDataContainer();

            jsonContainer.Buttons.Add(new ViewUrlButton()
            {
                Name = "历史消息", Url = "http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzIzOTM1MDYzNw==#wechat_webview_type=1&wechat_redirect"
            });
            api.JsonData = jsonContainer;
            api.Execute();

            IGetMenuApi api2     = new GetMenuApi(context);
            var         response = api2.ExecuteRawContent();

            Assert.IsNotNull(response);
            Console.WriteLine(response);

            IDeleteMenuApi api3 = new DeleteMenuApi(context);

            api3.Execute();
        }