コード例 #1
0
        public void BuildNullTest()
        {
            TextReplyMessage reply = null;

            var replyMessage = this.replyBuilder.ExecuteAsync(this.conversationContextMock.Object, null).Result;

            Assert.True(replyMessage.Text == null);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        /// <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());
        }