public void TestMixedContent() { var elem = new VoiceResponse(); elem.AddText("before") .AddChild("Child").AddText("content"); elem.AddText("after"); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Response>before<Child>content</Child>after</Response>", elem.ToString() ); }
static void Main() { var response = new VoiceResponse(); response.Say("Calling Twilio Pay"); response.AddText(""); response.Pay(chargeAmount: "20.45"); System.Console.WriteLine(response.ToString()); }
public void TestElementWithTextNode() { var elem = new VoiceResponse(); elem.AddText("Here is the content"); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Response>Here is the content</Response>", elem.ToString() ); }