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); }
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); }