public void BuildNullTest() { TextReplyMessage reply = null; var replyMessage = this.replyBuilder.ExecuteAsync(this.conversationContextMock.Object, null).Result; Assert.True(replyMessage.Text == null); }
public void BuildTest() { var reply = new TextReplyMessage { Text = "hello" }; var replyMessage = this.replyBuilder.ExecuteAsync(this.conversationContextMock.Object, reply).Result; Assert.True(replyMessage.Text == reply.Text); }
/// <summary> /// 发送被动响应文本消息 /// </summary> /// <param name="fromUserName">发送方</param> /// <param name="toUserName">接收方</param> /// <param name="content">文本内容</param> public static void SendTextReplyMessage(string fromUserName, string toUserName, string content) { TextReplyMessage msg = new TextReplyMessage() { CreateTime = Tools.ConvertDateTimeInt(DateTime.Now), FromUserName = fromUserName, ToUserName = toUserName, Content = content }; System.Web.HttpContext.Current.Response.Write(msg.ToXmlString()); }