public void can_build_originate_string() { var options = new OriginateOptions() { UUID = "985cea12-4e70-4c03-8a2c-2c4b4502bbbb", BypassMedia = true, CallerIdName = "Test", CallerIdNumber = "12341234", ExecuteOnOriginate = "start_dtmf", HangupAfterBridge = false, IgnoreEarlyMedia = true, Retries = 3, RetrySleepMs = 4000, ReturnRingReady = true, TimeoutSeconds = 20 }; options.ChannelVariables.Add("foo", "bar"); options.ChannelVariables.Add("baz", "widgets"); var toString = options.ToString(); const string Expected = "{origination_uuid='985cea12-4e70-4c03-8a2c-2c4b4502bbbb',bypass_media='true',origination_caller_id_name='Test',origination_caller_id_number='12341234',execute_on_originate='start_dtmf',ignore_early_media='true',originate_retries='3',originate_retry_sleep_ms='4000',return_ring_ready='true',originate_timeout='20',hangup_after_bridge='false',foo='bar',baz='widgets'}"; Assert.Equal(Expected, toString); }
public void Can_format_originate_options() { var options = new OriginateOptions() { CallerIdName = "Dan", CallerIdNumber = "0123457890", ExecuteOnOriginate = "my_app::my_arg", Retries = 5, RetrySleepMs = 200, ReturnRingReady = true, TimeoutSeconds = 60, UUID = "83fe4f3d-b957-4b26-b6bf-3879d7e21972", IgnoreEarlyMedia = true, }; Assert.Equal( "{origination_caller_id_name='Dan',origination_caller_id_number='0123457890',execute_on_originate='my_app::my_arg',originate_retries='5',originate_retry_sleep_ms='200',return_ring_ready='true',originate_timeout='60',origination_uuid='83fe4f3d-b957-4b26-b6bf-3879d7e21972',ignore_early_media='true'}", options.ToString()); }