示例#1
0
        public void Can_Generate_Enqueue_With_Name_And_Options()
        {
            var response = new TwilioResponse();
            response.Enqueue("example", new { action = "example.xml", method = "GET", waitUrl="wait.xml", waitUrlMethod="GET", workspaceSid="WSXXXXX" });

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#2
0
        public void Can_Generate_Enqueue_With_Options_And_TaskAttributes()
        {
            var response = new TwilioResponse();
            response.Enqueue(new { action = "example.xml", method = "GET", waitUrl = "wait.xml", waitUrlMethod = "GET", workspaceSid = "WSXXXXX" }, "{'task':'attributes'}");

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#3
0
        public void Can_Generate_Enqueue_With_Options_And_TaskAttributes_And_Priority_And_Timeout()
        {
            var response = new TwilioResponse();
            response.Enqueue(new { action = "example.xml", method = "GET", waitUrl = "wait.xml", waitUrlMethod = "GET", workflowSid = "WFXXXXX" }, "{'task':'attributes'}", new {priority="10", timeout="30"});

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#4
0
        public void Can_Generate_Enqueue_With_Name()
        {
            var response = new TwilioResponse();
            response.Enqueue("example");

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#5
0
        public void Can_Generate_Enqueue_With_Only_Options()
        {
            var response = new TwilioResponse();
            response.Enqueue(new { action = "example.xml", method = "GET", waitUrl = "wait.xml", waitUrlMethod = "GET"});

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#6
0
        public void Can_Generate_Single_Message()
        {
            var response = new TwilioResponse();
            response.Message("Hello world");

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#7
0
        public void Can_Generate_Enqueue_With_Task()
        {
            var response = new TwilioResponse();
            var task = new Task("{'task':'attributes'}", new {priority = "10", timeout = "30"});
            response.EnqueueTask(new { workflowSid = "WFXXXXX" }, task);

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#8
0
        public void Can_Generate_Single_Message_With_Attributes()
        {
            var response = new TwilioResponse();
            response.Message(
                "Hello world",
                new { to = "+15551111111", from = "+15552222222", action = "sms.php", method = "GET", statusCallback = "status.php" }
            );

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#9
0
        public void Can_Generate_Single_Message_With_Media()
        {
            var response = new TwilioResponse();
            response.Message(
                new string[] {
                    "http://example.com/1",
                    "http://example.com/2" },
                new { to = "+15551111111", from = "+15552222222", action = "sms.php", method = "GET", statusCallback = "status.php" }
            );

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }