Ejemplo n.º 1
0
        public void MakeOutboundCallFromJsonTest()
        {
            string json = "{\"to\":\"+18475978014\",\"from\":\"+12248806205\",\"callConnectUrl\":\"http://foo.com/Persephony/RecordingCallAnswered\",\"timeout\":27,\"ifMachine\":\"continue\"}";

            OutboundCall call = OutboundCall.fromJson(json);

            Assert.IsNotNull(call);
            Assert.AreEqual(call.getFrom, "+12248806205");
            Assert.AreEqual(call.getTo, "+18475978014");
            Assert.AreEqual(call.getCallConnectUrl, "http://foo.com/Persephony/RecordingCallAnswered");
            Assert.AreEqual(call.getTimeout, (uint)27);
            Assert.AreEqual(call.getIfMachine, EIfMachine.Continue);
        }
Ejemplo n.º 2
0
        public void MakeOutboundCallToJsonTest()
        {
            OutboundCall call = new OutboundCall();

            call.setTo("+18475978014");
            call.setFrom("+12248806205");
            call.setCallConnectUrl("http://foo.com/Persephony/RecordingCallAnswered");

            string json = call.toJson();

            Assert.IsNotNull(json);
            Assert.AreEqual(json, "{\"to\":\"+18475978014\",\"from\":\"+12248806205\",\"callConnectUrl\":\"http://foo.com/Persephony/RecordingCallAnswered\"}");
        }
Ejemplo n.º 3
0
        public void MakeOutboundCallFromJsonDefaultTest()
        {
            string json = "{\"to\":\"+18475978014\",\"from\":\"+12248806205\",\"callConnectUrl\":\"http://foo.com/FreeClimb/RecordingCallAnswered\",\"timeout\":27}";

            OutboundCall call = OutboundCall.fromJson(json);

            Assert.IsNotNull(call);
            Assert.AreEqual(call.getFrom, "+12248806205");
            Assert.AreEqual(call.getTo, "+18475978014");
            Assert.AreEqual(call.getCallConnectUrl, "http://foo.com/FreeClimb/RecordingCallAnswered");
            Assert.AreEqual(call.getTimeout, (uint)27);
            Assert.AreEqual(call.getIfMachine, EIfMachine.NONE);
        }