" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" words" + Environment.NewLine +
" words" + Environment.NewLine +
" words
" + Environment.NewLine +
diff --git a/test/Twilio.Test/TwiML/SsmlPTest.cs b/test/Twilio.Test/TwiML/SsmlPTest.cs
index 9534890a8..d204a21b0 100644
--- a/test/Twilio.Test/TwiML/SsmlPTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlPTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlP();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -77,7 +78,7 @@ public void TestElementWithChildren()
Assert.AreEqual(
"" + Environment.NewLine +
"" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" words" + Environment.NewLine +
" words" + Environment.NewLine +
" words" + Environment.NewLine +
diff --git a/test/Twilio.Test/TwiML/SsmlPhonemeTest.cs b/test/Twilio.Test/TwiML/SsmlPhonemeTest.cs
index 2469c3299..56ae26cd6 100644
--- a/test/Twilio.Test/TwiML/SsmlPhonemeTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlPhonemeTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlPhoneme();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
diff --git a/test/Twilio.Test/TwiML/SsmlProsodyTest.cs b/test/Twilio.Test/TwiML/SsmlProsodyTest.cs
index 1693cd6d8..1be35b31c 100644
--- a/test/Twilio.Test/TwiML/SsmlProsodyTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlProsodyTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlProsody();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -79,7 +80,7 @@ public void TestElementWithChildren()
Assert.AreEqual(
"" + Environment.NewLine +
"" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" words" + Environment.NewLine +
" words" + Environment.NewLine +
" words
" + Environment.NewLine +
diff --git a/test/Twilio.Test/TwiML/SsmlSTest.cs b/test/Twilio.Test/TwiML/SsmlSTest.cs
index 75a385799..93b3d07c4 100644
--- a/test/Twilio.Test/TwiML/SsmlSTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlSTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlS();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -75,7 +76,7 @@ public void TestElementWithChildren()
Assert.AreEqual(
"" + Environment.NewLine +
"" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" words" + Environment.NewLine +
" words" + Environment.NewLine +
" words" + Environment.NewLine +
diff --git a/test/Twilio.Test/TwiML/SsmlSayAsTest.cs b/test/Twilio.Test/TwiML/SsmlSayAsTest.cs
index 53a5e78eb..d9c2463e9 100644
--- a/test/Twilio.Test/TwiML/SsmlSayAsTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlSayAsTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlSayAs();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
diff --git a/test/Twilio.Test/TwiML/SsmlSubTest.cs b/test/Twilio.Test/TwiML/SsmlSubTest.cs
index 42a04f44d..92a2a93c9 100644
--- a/test/Twilio.Test/TwiML/SsmlSubTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlSubTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlSub();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
diff --git a/test/Twilio.Test/TwiML/SsmlWTest.cs b/test/Twilio.Test/TwiML/SsmlWTest.cs
index 52bee0a20..17d638db1 100644
--- a/test/Twilio.Test/TwiML/SsmlWTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlWTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlW();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -71,7 +72,7 @@ public void TestElementWithChildren()
Assert.AreEqual(
"" + Environment.NewLine +
"" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" words" + Environment.NewLine +
" words" + Environment.NewLine +
" words" + Environment.NewLine +
diff --git a/test/Twilio.Test/TwiML/StartTest.cs b/test/Twilio.Test/TwiML/StartTest.cs
index 0e6636434..34fbfd023 100644
--- a/test/Twilio.Test/TwiML/StartTest.cs
+++ b/test/Twilio.Test/TwiML/StartTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -32,7 +32,7 @@ public void TestElementWithParams()
var elem = new Start(new Uri("https://example.com"), Twilio.Http.HttpMethod.Get);
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Start();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -62,7 +63,7 @@ public void TestNestElement()
"" + Environment.NewLine +
"" + Environment.NewLine +
" " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" " + Environment.NewLine +
"",
elem.ToString()
@@ -88,8 +89,8 @@ public void TestElementWithChildren()
Assert.AreEqual(
"" + Environment.NewLine +
"" + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
"",
elem.ToString()
);
diff --git a/test/Twilio.Test/TwiML/StopTest.cs b/test/Twilio.Test/TwiML/StopTest.cs
index 7567c8f91..97259d47e 100644
--- a/test/Twilio.Test/TwiML/StopTest.cs
+++ b/test/Twilio.Test/TwiML/StopTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -32,10 +32,11 @@ public void TestElementWithExtraAttributes()
var elem = new Stop();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -51,7 +52,7 @@ public void TestNestElement()
"" + Environment.NewLine +
"" + Environment.NewLine +
" " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" " + Environment.NewLine +
"",
elem.ToString()
@@ -77,8 +78,8 @@ public void TestElementWithChildren()
Assert.AreEqual(
"" + Environment.NewLine +
"" + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
"",
elem.ToString()
);
diff --git a/test/Twilio.Test/TwiML/StreamTest.cs b/test/Twilio.Test/TwiML/StreamTest.cs
index a77bdf268..81136c30f 100644
--- a/test/Twilio.Test/TwiML/StreamTest.cs
+++ b/test/Twilio.Test/TwiML/StreamTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -39,7 +39,7 @@ public void TestElementWithParams()
);
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -50,10 +50,11 @@ public void TestElementWithExtraAttributes()
var elem = new Stream();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -68,7 +69,7 @@ public void TestElementWithChildren()
Assert.AreEqual(
"" + Environment.NewLine +
"" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
"",
elem.ToString()
);
diff --git a/test/Twilio.Test/TwiML/TaskTest.cs b/test/Twilio.Test/TwiML/TaskTest.cs
index f220a3a97..cce712d7e 100644
--- a/test/Twilio.Test/TwiML/TaskTest.cs
+++ b/test/Twilio.Test/TwiML/TaskTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Task();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
diff --git a/test/Twilio.Test/TwiML/VirtualAgentTest.cs b/test/Twilio.Test/TwiML/VirtualAgentTest.cs
index f96b53a9b..7c7b8a19c 100644
--- a/test/Twilio.Test/TwiML/VirtualAgentTest.cs
+++ b/test/Twilio.Test/TwiML/VirtualAgentTest.cs
@@ -21,7 +21,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -38,7 +38,7 @@ public void TestElementWithParams()
);
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -49,10 +49,11 @@ public void TestElementWithExtraAttributes()
var elem = new VirtualAgent();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -69,8 +70,8 @@ public void TestElementWithChildren()
Assert.AreEqual(
"" + Environment.NewLine +
"" + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
"",
elem.ToString()
);
diff --git a/test/Twilio.Test/TwiML/VoiceResponseTest.cs b/test/Twilio.Test/TwiML/VoiceResponseTest.cs
index 364f12cf2..ca0f011e1 100644
--- a/test/Twilio.Test/TwiML/VoiceResponseTest.cs
+++ b/test/Twilio.Test/TwiML/VoiceResponseTest.cs
@@ -22,7 +22,7 @@ public void TestEmptyElement()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -33,10 +33,11 @@ public void TestElementWithExtraAttributes()
var elem = new VoiceResponse();
elem.SetOption("newParam1", "value");
elem.SetOption("newParam2", 1);
+ elem.SetOption("xml:lang", "en");
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -52,7 +53,7 @@ public void TestNestElement()
"" + Environment.NewLine +
"" + Environment.NewLine +
" " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" " + Environment.NewLine +
"",
elem.ToString()
@@ -100,7 +101,7 @@ public void TestElementWithChildren()
);
elem.Gather(
- new[] {Gather.InputEnum.Dtmf},
+ new[] {Gather.InputEnum.Dtmf},
new Uri("https://example.com"),
Twilio.Http.HttpMethod.Get,
1,
@@ -204,26 +205,26 @@ public void TestElementWithChildren()
Assert.AreEqual(
"" + Environment.NewLine +
"" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" number" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" name" + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
" https://example.com" + Environment.NewLine +
" name" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" https://example.com" + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" message" + Environment.NewLine +
" message" + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
+ " " + Environment.NewLine +
"",
elem.ToString()
);
diff --git a/test/Twilio.Test/TwiML/XmlEscapeTest.cs b/test/Twilio.Test/TwiML/XmlEscapeTest.cs
new file mode 100644
index 000000000..509de6ee8
--- /dev/null
+++ b/test/Twilio.Test/TwiML/XmlEscapeTest.cs
@@ -0,0 +1,36 @@
+using NUnit.Framework;
+using System;
+using Twilio.TwiML.Messaging;
+
+namespace Twilio.Tests.TwiML
+{
+ [TestFixture]
+ public class XmlEscapeTest : TwilioTest
+ {
+ [Test]
+ public void TestXmlEscapedBodyMessage()
+ {
+ var elem = new Message("");
+
+ Assert.AreEqual(
+ "" + Environment.NewLine +
+ "<InvalidBodyMessage></InvalidBodyMessage>",
+ elem.ToString()
+ );
+ }
+
+ [Test]
+ public void TestXmlEscapedText()
+ {
+ var elem = new Message();
+ elem.AddText("");
+
+ Assert.AreEqual(
+ "" + Environment.NewLine +
+ "<InvalidText></InvalidText>",
+ elem.ToString()
+ );
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/test/Twilio.Test/Twilio.Test.csproj b/test/Twilio.Test/Twilio.Test.csproj
index 7dbe27ad0..747f9706c 100644
--- a/test/Twilio.Test/Twilio.Test.csproj
+++ b/test/Twilio.Test/Twilio.Test.csproj
@@ -2,14 +2,14 @@
Exe
Twilio.Tests
- net6.0;net451;net35
+ net7.0;net451;net35
win7-x86
win7-x86
false
false
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all