public void TestSendComplexTextMessage() { ComplexMessageContent complexMessageContent = new ComplexMessageContent("复杂文本消息概要", ComplexMessageType.Text); ComplexMessageContentItem contentItem = new ComplexMessageContentItem("这里是复杂文本消息的内容"); complexMessageContent.AddMessageContentItem(contentItem); SendMessageResult result = _messageClient.SendSingleMessage(complexMessageContent, new PersonMessageReceiver("zhongt", "钟涛")); Assert.AreEqual(true, result.Success); }
public void TestSendOpenHtmlMessage() { ComplexMessageContent complexTextMessage = new ComplexMessageContent("演示打开一个HTML的Action消息", ComplexMessageType.Text); ComplexMessageContentItem contentItem = new ComplexMessageContentItem("点击可以打开HTML页面", Action.InstanceAsOpenHtml("<div><b>这里是HTML的详细内容</b></div>")); complexTextMessage.AddMessageContentItem(contentItem); SendMessageResult result = _messageClient.SendSingleMessage(complexTextMessage, new PersonMessageReceiver("zhongt", "钟涛")); Assert.AreEqual(true, result.Success); }
public void TestSendOpenUrlMessage() { ComplexMessageContent complexTextMessage = new ComplexMessageContent("演示打开一个远程URL的Action消息", ComplexMessageType.Text); ComplexMessageContentItem contentItem = new ComplexMessageContentItem("点击可以打开远程URL页面", Action.InstanceAsOpenUrl("http://www.xiaomi.com")); complexTextMessage.AddMessageContentItem(contentItem); SendMessageResult result = _messageClient.SendSingleMessage(complexTextMessage, new PersonMessageReceiver("zhongt", "钟涛")); Assert.AreEqual(true, result.Success); }
public void TestSendOpenNativeFunctionMessageAsOpenBingoTouchRemotePage() { ComplexMessageContent complexTextMessage = new ComplexMessageContent("演示打开一个Bingotouch远程页面的Action消息", ComplexMessageType.Text); ComplexMessageContentItem contentItem = new ComplexMessageContentItem("点击可以打开BingoTouch远程应用页面", Action.InstanceAsOpenNative(NativeCommandAndParamsBuilder.BuildAsOpenBingoTouchRemoteAppPage("http://www.mi.com"))); complexTextMessage.AddMessageContentItem(contentItem); SendMessageResult result = _messageClient.SendSingleMessage(complexTextMessage, new PersonMessageReceiver("zhongt", "钟涛")); Assert.AreEqual(true, result.Success); }
public void TestSendOpenNativeFunctionMessageAsOpenBingoTouchLocalPage() { ComplexMessageContent complexTextMessage = new ComplexMessageContent("演示打开一个Bingotouch本地应用页面的Action消息", ComplexMessageType.Text); ComplexMessageContentItem contentItem = new ComplexMessageContentItem("点击可以打开BingoTouch本地应用页面", Action.InstanceAsOpenNative(NativeCommandAndParamsBuilder.BuildAsOpenBingoTouchLocalAppPage("BingoService", "/modules/leave/addleave.html"))); complexTextMessage.AddMessageContentItem(contentItem); SendMessageResult result = _messageClient.SendSingleMessage(complexTextMessage, new PersonMessageReceiver("zhongt", "钟涛")); Assert.AreEqual(true, result.Success); }
public void TestSendOpenNativeFunctionMessage() { ComplexMessageContent complexTextMessage = new ComplexMessageContent("演示打开一个原生指令的Action消息", ComplexMessageType.Text); ComplexMessageContentItem contentItem = new ComplexMessageContentItem("点击可以打开原生的聊天页面", Action.InstanceAsOpenNative(NativeCommandAndParamsBuilder.BuildAsOpenNativeFunction("StartChat"))); complexTextMessage.AddMessageContentItem(contentItem); SendMessageResult result = _messageClient.SendSingleMessage(complexTextMessage, new PersonMessageReceiver("zhongt", "钟涛")); Assert.AreEqual(true, result.Success); }
public void TestSendRichMessage() { ComplexMessageContent complexTextMessage = new ComplexMessageContent("富文本消息消息概要", ComplexMessageType.RichText); ComplexMessageContentItem contentItem = new ComplexMessageContentItem("这是富文本消息", "http://img03.mifile.cn/webfile/images/2014/cn/goods/headphone/specs-01.png", Action.InstanceAsOpenHtml("<b>你好,富文本消息!!</b>") ); complexTextMessage.AddMessageContentItem(contentItem); SendMessageResult result = _messageClient.SendSingleMessage(complexTextMessage, new PersonMessageReceiver("zhongt", "钟涛")); Assert.AreEqual(true, result.Success); }
public void TestSendImageTextMessage() { ComplexMessageContent complexTextMessage = new ComplexMessageContent("图文消息消息概要", ComplexMessageType.ImageText); ComplexMessageContentItem contentItem1 = new ComplexMessageContentItem("图文消息--URL", "http://img03.mifile.cn/webfile/images/2014/cn/goods/headphone/specs-01.png", Action.InstanceAsOpenUrl("http://www.mi.com") ); complexTextMessage.AddMessageContentItem(contentItem1); ComplexMessageContentItem contentItem2 = new ComplexMessageContentItem("图文消息--HTML", "http://img03.mifile.cn/webfile/images/2014/cn/goods/headphone/specs-01.png", Action.InstanceAsOpenHtml("<b>这里是富文本消息的基本内容</b>") ); complexTextMessage.AddMessageContentItem(contentItem2); SendMessageResult result = _messageClient.SendSingleMessage(complexTextMessage, new PersonMessageReceiver("zhongt", "钟涛")); Assert.AreEqual(true, result.Success); }