示例#1
0
        public void SetBodyWorks()
        {
            string   body     = "body text";
            Routable routable = this.CreateMessage();

            routable.SetBody <string>(body);
            Assert.AreEqual(body, routable.Body);
        }
示例#2
0
        public void CanUploadFile(bool stringBody)
        {
            Mock <IWebRequestUtility> webRequestUtility = this.GetWebRequest();
            To       to       = new To(this.GetRoute().Headers, webRequestUtility.Object);
            Routable routable = new Routable(new Dictionary <string, string>()
            {
                { "SourceFile", "Test.txt" }
            },
                                             Encoding.UTF8.GetBytes("Hello")
                                             );

            if (stringBody)
            {
                routable.SetBody <string>("Hello");
            }

            to.Process(routable);
            webRequestUtility.VerifyAll();
        }
示例#3
0
 public void Process(Routable routable)
 {
     routable.SetBody <string>("Kyameru testing...sorry #notsorry");
 }
示例#4
0
 public void Process(Routable routable)
 {
     routable.SetBody <string>(System.Text.Encoding.UTF8.GetString(
                                   (byte[])routable.Body));
     this.Log(LogLevel.Information, routable.Headers["DataType"]);
 }
示例#5
0
 public void Process(Routable item)
 {
     GlobalCalls.Calls.Add("TO");
     item.SetBody <string>("Injected Test Complete");
     this.OnLog?.Invoke(this, new Log(LogLevel.Information, "TO"));
 }
示例#6
0
 public bool IsEqual(Routable routable)
 {
     routable.SetBody <T>(item);
     return(expected == routable.Headers["DataType"]);
 }