" + 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..81841d8b6 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()
);
}
@@ -46,7 +46,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -77,7 +77,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..f1db84c52 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()
);
}
@@ -46,7 +46,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
diff --git a/test/Twilio.Test/TwiML/SsmlProsodyTest.cs b/test/Twilio.Test/TwiML/SsmlProsodyTest.cs
index 1693cd6d8..324ddea7f 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()
);
}
@@ -46,7 +46,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -79,7 +79,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..fe22d57b5 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()
);
}
@@ -46,7 +46,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -75,7 +75,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..c53c859ac 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()
);
}
@@ -46,7 +46,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
diff --git a/test/Twilio.Test/TwiML/SsmlSubTest.cs b/test/Twilio.Test/TwiML/SsmlSubTest.cs
index 42a04f44d..59593bca1 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()
);
}
@@ -46,7 +46,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
diff --git a/test/Twilio.Test/TwiML/SsmlWTest.cs b/test/Twilio.Test/TwiML/SsmlWTest.cs
index 52bee0a20..7b680bd44 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()
);
}
@@ -46,7 +46,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -71,7 +71,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..3b5b1d79d 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()
);
}
@@ -46,7 +46,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -62,7 +62,7 @@ public void TestNestElement()
"" + Environment.NewLine +
"" + Environment.NewLine +
" " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" " + Environment.NewLine +
"",
elem.ToString()
@@ -88,8 +88,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..aab49dd8a 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()
);
}
@@ -35,7 +35,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -51,7 +51,7 @@ public void TestNestElement()
"" + Environment.NewLine +
"" + Environment.NewLine +
" " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" " + Environment.NewLine +
"",
elem.ToString()
@@ -77,8 +77,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..9add99695 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()
);
}
@@ -53,7 +53,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -68,7 +68,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..f9eaa5961 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()
);
}
@@ -46,7 +46,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
diff --git a/test/Twilio.Test/TwiML/VirtualAgentTest.cs b/test/Twilio.Test/TwiML/VirtualAgentTest.cs
index f96b53a9b..5e4e4ee9e 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()
);
}
@@ -52,7 +52,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -69,8 +69,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 6779d8c47..5a6ee713e 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()
);
}
@@ -36,7 +36,7 @@ public void TestElementWithExtraAttributes()
Assert.AreEqual(
"" + Environment.NewLine +
- "",
+ "",
elem.ToString()
);
}
@@ -52,7 +52,7 @@ public void TestNestElement()
"" + Environment.NewLine +
"" + Environment.NewLine +
" " + Environment.NewLine +
- " " + Environment.NewLine +
+ " " + Environment.NewLine +
" " + Environment.NewLine +
"",
elem.ToString()
@@ -204,26 +204,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 3b44e7ec9..e35dc1257 100644
--- a/test/Twilio.Test/Twilio.Test.csproj
+++ b/test/Twilio.Test/Twilio.Test.csproj
@@ -2,21 +2,22 @@
Exe
Twilio.Tests
- netcoreapp2.0;net451;net35
+ net451;net35;net60
win7-x86
win7-x86
false
+ false
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
-
-
-
+
+
+
+
+
From 8816ba14e5c942350d6cf2c62f0e494d0f3ecece Mon Sep 17 00:00:00 2001
From: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com>
Date: Thu, 2 Feb 2023 12:36:46 -0500
Subject: [PATCH 2/3] Document methods
---
src/Twilio/TwiML/TwiMLSerializer.cs | 146 +++++++++++++++++++---------
1 file changed, 102 insertions(+), 44 deletions(-)
diff --git a/src/Twilio/TwiML/TwiMLSerializer.cs b/src/Twilio/TwiML/TwiMLSerializer.cs
index 37ad002b1..5bf4818fb 100644
--- a/src/Twilio/TwiML/TwiMLSerializer.cs
+++ b/src/Twilio/TwiML/TwiMLSerializer.cs
@@ -21,8 +21,8 @@ public partial class TwiML
///
/// Attribute names to be transformed on the generated xml
///
- private static Dictionary AttributeNameMapper = new Dictionary {{"for_", "for"}};
-
+ private static Dictionary AttributeNameMapper = new Dictionary { { "for_", "for" } };
+
///
/// Generate XElement from TwiML object
///
@@ -31,7 +31,7 @@ protected virtual XNode ToXml()
{
var elem = new XElement(TagName, GetElementBody());
- foreach(var attr in GetElementAttributes())
+ foreach (var attr in GetElementAttributes())
{
string transformedAttr = attr.Name.LocalName;
if (AttributeNameMapper.TryGetValue(attr.Name.LocalName, out transformedAttr))
@@ -72,45 +72,66 @@ public XDocument ToXDocument()
var elem = ToXml();
var document = new XDocument(declaration, elem);
return document;
- }
-
+ }
+
+ ///
+ /// Write TwiML to TextWriter as XML.
+ ///
+ /// TextWriter to write XML string to.
public void Save(TextWriter textWriter)
{
Save(textWriter, SaveOptions.None);
- }
-
- public void Save(TextWriter textWriter, SaveOptions options)
+ }
+
+ ///
+ /// Write TwiML to TextWriter as XML.
+ ///
+ /// TextWriter to write XML string to.
+ /// Change generated string format.
+ public void Save(TextWriter textWriter, SaveOptions formattingOptions)
{
- var ws = GetXmlWriterSettings(options);
+ var ws = GetXmlWriterSettings(formattingOptions);
using (var writer = XmlWriter.Create(textWriter, ws))
- Save(writer, options);
- }
-
+ Save(writer);
+ }
+
+ ///
+ /// Write TwiML to Stream as XML.
+ ///
+ /// Stream to write XML string to.
public void Save(Stream stream)
{
Save(stream, SaveOptions.None);
- }
-
- public void Save(Stream stream, SaveOptions options)
+ }
+
+ ///
+ /// Write TwiML to Stream as XML.
+ ///
+ /// Stream to write XML string to.
+ /// Change generated string format.
+ public void Save(Stream stream, SaveOptions formattingOptions)
{
- var ws = GetXmlWriterSettings(options);
+ var ws = GetXmlWriterSettings(formattingOptions);
using (var writer = XmlWriter.Create(stream, ws))
- Save(writer, options);
- }
-
+ Save(writer);
+ }
+
+ ///
+ /// Write TwiML to XmlWriter as XML. Configure the XmlWriter before invoking Save.
+ ///
+ /// XmlWriter to write XML string to.
public void Save(XmlWriter writer)
- {
- Save(writer, SaveOptions.None);
- }
-
- public void Save(XmlWriter writer, SaveOptions options)
{
writer.WriteStartDocument();
WriteContent(writer);
writer.WriteEndDocument();
writer.Flush();
- }
-
+ }
+
+ ///
+ /// Write the Element, Attributes, and inner XML of this TwiML object.
+ ///
+ /// XmlWriter to write XML string to.
protected virtual void WriteContent(XmlWriter writer)
{
writer.WriteStartElement(null, TagName, null);
@@ -172,15 +193,30 @@ protected virtual void WriteContent(XmlWriter writer)
writer.WriteEndElement();
}
-#if !NET35
+#if !NET35
+ ///
+ /// Write TwiML to TextWriter as XML.
+ ///
+ /// TextWriter to write XML string to.
+ /// A cancellation token.
public Task SaveAsync(TextWriter textWriter, CancellationToken cancellationToken)
{
return SaveAsync(textWriter, SaveOptions.None, cancellationToken);
- }
-
- public async Task SaveAsync(TextWriter textWriter, SaveOptions options, CancellationToken cancellationToken)
+ }
+
+ ///
+ /// Write TwiML to TextWriter as XML.
+ ///
+ /// TextWriter to write XML string to.
+ /// Change generated string format.
+ /// A cancellation token.
+ public async Task SaveAsync(
+ TextWriter textWriter, SaveOptions
+ formattingOptions,
+ CancellationToken cancellationToken
+ )
{
- var ws = GetXmlWriterSettings(options);
+ var ws = GetXmlWriterSettings(formattingOptions);
ws.Async = true;
var writer = XmlWriter.Create(textWriter, ws);
#if NET6_0_OR_GREATER
@@ -192,16 +228,27 @@ public async Task SaveAsync(TextWriter textWriter, SaveOptions options, Cancella
#endif
await SaveAsync(writer, cancellationToken).ConfigureAwait(false);
}
- }
-
+ }
+
+ ///
+ /// Write TwiML to Stream as XML.
+ ///
+ /// Stream to write XML string to.
+ /// A cancellation token.
public Task SaveAsync(Stream stream, CancellationToken cancellationToken)
{
return SaveAsync(stream, SaveOptions.None, cancellationToken);
- }
-
- public async Task SaveAsync(Stream stream, SaveOptions options, CancellationToken cancellationToken)
+ }
+
+ ///
+ /// Write TwiML to Stream as XML.
+ ///
+ /// Stream to write XML string to.
+ /// Change generated string format.
+ /// A cancellation token.
+ public async Task SaveAsync(Stream stream, SaveOptions formattingOptions, CancellationToken cancellationToken)
{
- var ws = GetXmlWriterSettings(options);
+ var ws = GetXmlWriterSettings(formattingOptions);
ws.Async = true;
var writer = XmlWriter.Create(stream, ws);
#if NET6_0_OR_GREATER
@@ -213,16 +260,26 @@ public async Task SaveAsync(Stream stream, SaveOptions options, CancellationToke
#endif
await SaveAsync(writer, cancellationToken).ConfigureAwait(false);
}
- }
-
+ }
+
+ ///
+ /// Write TwiML to XmlWriter as XML. Configure the XmlWriter before invoking Save.
+ ///
+ /// XmlWriter to write XML string to.
+ /// A cancellation token.
public async Task SaveAsync(XmlWriter writer, CancellationToken cancellationToken)
{
await writer.WriteStartDocumentAsync().ConfigureAwait(false);
await WriteXml(writer, cancellationToken).ConfigureAwait(false);
await writer.WriteEndDocumentAsync().ConfigureAwait(false);
await writer.FlushAsync().ConfigureAwait(false);
- }
-
+ }
+
+ ///
+ /// Write the Element, Attributes, and inner XML of this TwiML object.
+ ///
+ /// XmlWriter to write XML string to.
+ /// A cancellation token.
protected virtual async Task WriteXml(XmlWriter writer, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -292,6 +349,7 @@ private static XmlWriterSettings GetXmlWriterSettings(SaveOptions saveOptions)
{
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8;
+
if ((saveOptions & SaveOptions.DisableFormatting) == 0) settings.Indent = true;
#if !NET35
if ((saveOptions & SaveOptions.OmitDuplicateNamespaces) != 0)
@@ -301,7 +359,7 @@ private static XmlWriterSettings GetXmlWriterSettings(SaveOptions saveOptions)
}
///
- /// Generate XML string from TwiML object
+ /// Generate XML string from TwiML object.
///
public override string ToString()
{
@@ -309,9 +367,9 @@ public override string ToString()
}
///
- /// Generate XML string from TwiML object
+ /// Generate XML string from TwiML object.
///
- /// Change generated string format.
+ /// Change generated string format.
public string ToString(SaveOptions formattingOptions)
{
using (var writer = new Utf8StringWriter())
From 4a05866ba7131605fe55b47899bbed6b1d56c01c Mon Sep 17 00:00:00 2001
From: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com>
Date: Tue, 6 Jun 2023 18:17:53 -0400
Subject: [PATCH 3/3] add xml:lang attr to tests
---
test/Twilio.Test/TwiML/ApplicationSidTest.cs | 3 ++-
test/Twilio.Test/TwiML/ApplicationTest.cs | 3 ++-
test/Twilio.Test/TwiML/AutopilotTest.cs | 3 ++-
test/Twilio.Test/TwiML/BodyTest.cs | 1 +
test/Twilio.Test/TwiML/ClientTest.cs | 3 ++-
test/Twilio.Test/TwiML/ConferenceTest.cs | 3 ++-
test/Twilio.Test/TwiML/ConfigTest.cs | 3 ++-
test/Twilio.Test/TwiML/ConnectTest.cs | 3 ++-
test/Twilio.Test/TwiML/ConversationTest.cs | 3 ++-
test/Twilio.Test/TwiML/DialTest.cs | 3 ++-
test/Twilio.Test/TwiML/EchoTest.cs | 3 ++-
test/Twilio.Test/TwiML/EnqueueTest.cs | 3 ++-
test/Twilio.Test/TwiML/FaxResponseTest.cs | 3 ++-
test/Twilio.Test/TwiML/GatherTest.cs | 3 ++-
test/Twilio.Test/TwiML/HangupTest.cs | 3 ++-
test/Twilio.Test/TwiML/IdentityTest.cs | 3 ++-
test/Twilio.Test/TwiML/LeaveTest.cs | 3 ++-
test/Twilio.Test/TwiML/MediaTest.cs | 3 ++-
test/Twilio.Test/TwiML/MessageTest.cs | 3 ++-
test/Twilio.Test/TwiML/MessagingResponseTest.cs | 3 ++-
test/Twilio.Test/TwiML/NumberTest.cs | 3 ++-
test/Twilio.Test/TwiML/ParameterTest.cs | 3 ++-
test/Twilio.Test/TwiML/PauseTest.cs | 3 ++-
test/Twilio.Test/TwiML/PayTest.cs | 3 ++-
test/Twilio.Test/TwiML/PlayTest.cs | 3 ++-
test/Twilio.Test/TwiML/PromptTest.cs | 3 ++-
test/Twilio.Test/TwiML/QueueTest.cs | 3 ++-
test/Twilio.Test/TwiML/ReceiveTest.cs | 3 ++-
test/Twilio.Test/TwiML/RecordTest.cs | 3 ++-
test/Twilio.Test/TwiML/RedirectTest.cs | 3 ++-
test/Twilio.Test/TwiML/ReferSipTest.cs | 3 ++-
test/Twilio.Test/TwiML/ReferTest.cs | 3 ++-
test/Twilio.Test/TwiML/RejectTest.cs | 3 ++-
test/Twilio.Test/TwiML/RoomTest.cs | 3 ++-
test/Twilio.Test/TwiML/SayTest.cs | 3 ++-
test/Twilio.Test/TwiML/SimTest.cs | 3 ++-
test/Twilio.Test/TwiML/SipTest.cs | 3 ++-
test/Twilio.Test/TwiML/SiprecTest.cs | 3 ++-
test/Twilio.Test/TwiML/SmsTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlBreakTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlEmphasisTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlLangTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlPTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlPhonemeTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlProsodyTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlSTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlSayAsTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlSubTest.cs | 3 ++-
test/Twilio.Test/TwiML/SsmlWTest.cs | 3 ++-
test/Twilio.Test/TwiML/StartTest.cs | 3 ++-
test/Twilio.Test/TwiML/StopTest.cs | 3 ++-
test/Twilio.Test/TwiML/StreamTest.cs | 3 ++-
test/Twilio.Test/TwiML/TaskTest.cs | 3 ++-
test/Twilio.Test/TwiML/VirtualAgentTest.cs | 3 ++-
test/Twilio.Test/TwiML/VoiceResponseTest.cs | 5 +++--
test/Twilio.Test/Twilio.Test.csproj | 2 +-
56 files changed, 111 insertions(+), 56 deletions(-)
diff --git a/test/Twilio.Test/TwiML/ApplicationSidTest.cs b/test/Twilio.Test/TwiML/ApplicationSidTest.cs
index fbb2121d0..a8b0e01dd 100644
--- a/test/Twilio.Test/TwiML/ApplicationSidTest.cs
+++ b/test/Twilio.Test/TwiML/ApplicationSidTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new ApplicationSid();
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/ApplicationTest.cs b/test/Twilio.Test/TwiML/ApplicationTest.cs
index 1d1317534..f9d2c85f8 100644
--- a/test/Twilio.Test/TwiML/ApplicationTest.cs
+++ b/test/Twilio.Test/TwiML/ApplicationTest.cs
@@ -52,10 +52,11 @@ public void TestElementWithExtraAttributes()
var elem = new Application();
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/AutopilotTest.cs b/test/Twilio.Test/TwiML/AutopilotTest.cs
index 6061a66e6..2b19858e6 100644
--- a/test/Twilio.Test/TwiML/AutopilotTest.cs
+++ b/test/Twilio.Test/TwiML/AutopilotTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Autopilot();
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/BodyTest.cs b/test/Twilio.Test/TwiML/BodyTest.cs
index e8bff6e92..72c6480cb 100644
--- a/test/Twilio.Test/TwiML/BodyTest.cs
+++ b/test/Twilio.Test/TwiML/BodyTest.cs
@@ -96,4 +96,5 @@ public void TestMixedContent()
);
}
}
+
}
\ No newline at end of file
diff --git a/test/Twilio.Test/TwiML/ClientTest.cs b/test/Twilio.Test/TwiML/ClientTest.cs
index b3f2d013a..e95318edc 100644
--- a/test/Twilio.Test/TwiML/ClientTest.cs
+++ b/test/Twilio.Test/TwiML/ClientTest.cs
@@ -50,10 +50,11 @@ public void TestElementWithExtraAttributes()
var elem = new Client();
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/ConferenceTest.cs b/test/Twilio.Test/TwiML/ConferenceTest.cs
index d76246f0d..9fbc9337f 100644
--- a/test/Twilio.Test/TwiML/ConferenceTest.cs
+++ b/test/Twilio.Test/TwiML/ConferenceTest.cs
@@ -65,10 +65,11 @@ public void TestElementWithExtraAttributes()
var elem = new Conference();
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/ConfigTest.cs b/test/Twilio.Test/TwiML/ConfigTest.cs
index 3fb89af75..4d9a8613a 100644
--- a/test/Twilio.Test/TwiML/ConfigTest.cs
+++ b/test/Twilio.Test/TwiML/ConfigTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Config();
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/ConnectTest.cs b/test/Twilio.Test/TwiML/ConnectTest.cs
index 0db081ed2..e53fbc209 100644
--- a/test/Twilio.Test/TwiML/ConnectTest.cs
+++ b/test/Twilio.Test/TwiML/ConnectTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Connect();
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/ConversationTest.cs b/test/Twilio.Test/TwiML/ConversationTest.cs
index 4cdfe51d4..58e399997 100644
--- a/test/Twilio.Test/TwiML/ConversationTest.cs
+++ b/test/Twilio.Test/TwiML/ConversationTest.cs
@@ -58,10 +58,11 @@ public void TestElementWithExtraAttributes()
var elem = new Conversation();
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/DialTest.cs b/test/Twilio.Test/TwiML/DialTest.cs
index f70afc2fc..962cc6be8 100644
--- a/test/Twilio.Test/TwiML/DialTest.cs
+++ b/test/Twilio.Test/TwiML/DialTest.cs
@@ -62,10 +62,11 @@ public void TestElementWithExtraAttributes()
var elem = new Dial();
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/EchoTest.cs b/test/Twilio.Test/TwiML/EchoTest.cs
index dfecc4687..c88f8b31f 100644
--- a/test/Twilio.Test/TwiML/EchoTest.cs
+++ b/test/Twilio.Test/TwiML/EchoTest.cs
@@ -32,10 +32,11 @@ public void TestElementWithExtraAttributes()
var elem = new Echo();
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/EnqueueTest.cs b/test/Twilio.Test/TwiML/EnqueueTest.cs
index daf0ae7d4..6a1858585 100644
--- a/test/Twilio.Test/TwiML/EnqueueTest.cs
+++ b/test/Twilio.Test/TwiML/EnqueueTest.cs
@@ -51,10 +51,11 @@ public void TestElementWithExtraAttributes()
var elem = new Enqueue();
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/FaxResponseTest.cs b/test/Twilio.Test/TwiML/FaxResponseTest.cs
index 80fb32072..553ec50b6 100644
--- a/test/Twilio.Test/TwiML/FaxResponseTest.cs
+++ b/test/Twilio.Test/TwiML/FaxResponseTest.cs
@@ -33,10 +33,11 @@ public void TestElementWithExtraAttributes()
var elem = new FaxResponse();
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/GatherTest.cs b/test/Twilio.Test/TwiML/GatherTest.cs
index 04bcaac04..f728f1dc0 100644
--- a/test/Twilio.Test/TwiML/GatherTest.cs
+++ b/test/Twilio.Test/TwiML/GatherTest.cs
@@ -62,10 +62,11 @@ public void TestElementWithExtraAttributes()
var elem = new Gather();
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/HangupTest.cs b/test/Twilio.Test/TwiML/HangupTest.cs
index b116ae420..1e572fa47 100644
--- a/test/Twilio.Test/TwiML/HangupTest.cs
+++ b/test/Twilio.Test/TwiML/HangupTest.cs
@@ -32,10 +32,11 @@ public void TestElementWithExtraAttributes()
var elem = new Hangup();
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/IdentityTest.cs b/test/Twilio.Test/TwiML/IdentityTest.cs
index 5fd1f175e..6b036ca3e 100644
--- a/test/Twilio.Test/TwiML/IdentityTest.cs
+++ b/test/Twilio.Test/TwiML/IdentityTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Identity();
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/LeaveTest.cs b/test/Twilio.Test/TwiML/LeaveTest.cs
index 0dd8db4f8..f68d76d2f 100644
--- a/test/Twilio.Test/TwiML/LeaveTest.cs
+++ b/test/Twilio.Test/TwiML/LeaveTest.cs
@@ -32,10 +32,11 @@ public void TestElementWithExtraAttributes()
var elem = new Leave();
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/MediaTest.cs b/test/Twilio.Test/TwiML/MediaTest.cs
index 4336d712d..2e461b051 100644
--- a/test/Twilio.Test/TwiML/MediaTest.cs
+++ b/test/Twilio.Test/TwiML/MediaTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Media();
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/MessageTest.cs b/test/Twilio.Test/TwiML/MessageTest.cs
index 691c07c32..d7c619cdb 100644
--- a/test/Twilio.Test/TwiML/MessageTest.cs
+++ b/test/Twilio.Test/TwiML/MessageTest.cs
@@ -50,10 +50,11 @@ public void TestElementWithExtraAttributes()
var elem = new Message();
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/MessagingResponseTest.cs b/test/Twilio.Test/TwiML/MessagingResponseTest.cs
index 578ce1b82..b7abe7182 100644
--- a/test/Twilio.Test/TwiML/MessagingResponseTest.cs
+++ b/test/Twilio.Test/TwiML/MessagingResponseTest.cs
@@ -33,10 +33,11 @@ public void TestElementWithExtraAttributes()
var elem = new MessagingResponse();
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/NumberTest.cs b/test/Twilio.Test/TwiML/NumberTest.cs
index 641e738a1..1ac86c254 100644
--- a/test/Twilio.Test/TwiML/NumberTest.cs
+++ b/test/Twilio.Test/TwiML/NumberTest.cs
@@ -59,10 +59,11 @@ public void TestElementWithExtraAttributes()
var elem = new Number();
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/ParameterTest.cs b/test/Twilio.Test/TwiML/ParameterTest.cs
index 70f12862c..108772ce3 100644
--- a/test/Twilio.Test/TwiML/ParameterTest.cs
+++ b/test/Twilio.Test/TwiML/ParameterTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Parameter();
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/PauseTest.cs b/test/Twilio.Test/TwiML/PauseTest.cs
index b3f153cda..53761439d 100644
--- a/test/Twilio.Test/TwiML/PauseTest.cs
+++ b/test/Twilio.Test/TwiML/PauseTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Pause();
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/PayTest.cs b/test/Twilio.Test/TwiML/PayTest.cs
index b80d63d1f..affdbefde 100644
--- a/test/Twilio.Test/TwiML/PayTest.cs
+++ b/test/Twilio.Test/TwiML/PayTest.cs
@@ -62,10 +62,11 @@ public void TestElementWithExtraAttributes()
var elem = new Pay();
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/PlayTest.cs b/test/Twilio.Test/TwiML/PlayTest.cs
index a30dc9637..2051fe6f6 100644
--- a/test/Twilio.Test/TwiML/PlayTest.cs
+++ b/test/Twilio.Test/TwiML/PlayTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Play();
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/PromptTest.cs b/test/Twilio.Test/TwiML/PromptTest.cs
index 4fc2aa0d9..368cf134f 100644
--- a/test/Twilio.Test/TwiML/PromptTest.cs
+++ b/test/Twilio.Test/TwiML/PromptTest.cs
@@ -49,10 +49,11 @@ public void TestElementWithExtraAttributes()
var elem = new Prompt();
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/QueueTest.cs b/test/Twilio.Test/TwiML/QueueTest.cs
index 223c04fb1..8394499a6 100644
--- a/test/Twilio.Test/TwiML/QueueTest.cs
+++ b/test/Twilio.Test/TwiML/QueueTest.cs
@@ -49,10 +49,11 @@ public void TestElementWithExtraAttributes()
var elem = new Queue();
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/ReceiveTest.cs b/test/Twilio.Test/TwiML/ReceiveTest.cs
index c3dafa4d8..cb273972a 100644
--- a/test/Twilio.Test/TwiML/ReceiveTest.cs
+++ b/test/Twilio.Test/TwiML/ReceiveTest.cs
@@ -49,10 +49,11 @@ public void TestElementWithExtraAttributes()
var elem = new Receive();
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/RecordTest.cs b/test/Twilio.Test/TwiML/RecordTest.cs
index 5166c4824..319f48274 100644
--- a/test/Twilio.Test/TwiML/RecordTest.cs
+++ b/test/Twilio.Test/TwiML/RecordTest.cs
@@ -56,10 +56,11 @@ public void TestElementWithExtraAttributes()
var elem = new Record();
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/RedirectTest.cs b/test/Twilio.Test/TwiML/RedirectTest.cs
index 7d371228f..d19b555d4 100644
--- a/test/Twilio.Test/TwiML/RedirectTest.cs
+++ b/test/Twilio.Test/TwiML/RedirectTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Redirect();
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/ReferSipTest.cs b/test/Twilio.Test/TwiML/ReferSipTest.cs
index 5a19eca86..988ca399f 100644
--- a/test/Twilio.Test/TwiML/ReferSipTest.cs
+++ b/test/Twilio.Test/TwiML/ReferSipTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new ReferSip();
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/ReferTest.cs b/test/Twilio.Test/TwiML/ReferTest.cs
index 727bf8795..faff70453 100644
--- a/test/Twilio.Test/TwiML/ReferTest.cs
+++ b/test/Twilio.Test/TwiML/ReferTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Refer();
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/RejectTest.cs b/test/Twilio.Test/TwiML/RejectTest.cs
index 18af14ae0..fad737b35 100644
--- a/test/Twilio.Test/TwiML/RejectTest.cs
+++ b/test/Twilio.Test/TwiML/RejectTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Reject();
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/RoomTest.cs b/test/Twilio.Test/TwiML/RoomTest.cs
index f08e6aba2..60a6a6006 100644
--- a/test/Twilio.Test/TwiML/RoomTest.cs
+++ b/test/Twilio.Test/TwiML/RoomTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Room();
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/SayTest.cs b/test/Twilio.Test/TwiML/SayTest.cs
index 80915edf7..78a39be35 100644
--- a/test/Twilio.Test/TwiML/SayTest.cs
+++ b/test/Twilio.Test/TwiML/SayTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Say();
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/SimTest.cs b/test/Twilio.Test/TwiML/SimTest.cs
index f2e86d3b0..5db8bade9 100644
--- a/test/Twilio.Test/TwiML/SimTest.cs
+++ b/test/Twilio.Test/TwiML/SimTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Sim();
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/SipTest.cs b/test/Twilio.Test/TwiML/SipTest.cs
index 38a150b48..752ab7edd 100644
--- a/test/Twilio.Test/TwiML/SipTest.cs
+++ b/test/Twilio.Test/TwiML/SipTest.cs
@@ -59,10 +59,11 @@ public void TestElementWithExtraAttributes()
var elem = new Sip();
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/SiprecTest.cs b/test/Twilio.Test/TwiML/SiprecTest.cs
index b474e3a6c..a832229e5 100644
--- a/test/Twilio.Test/TwiML/SiprecTest.cs
+++ b/test/Twilio.Test/TwiML/SiprecTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new Siprec();
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/SmsTest.cs b/test/Twilio.Test/TwiML/SmsTest.cs
index f7934b43c..cb0a2fb3e 100644
--- a/test/Twilio.Test/TwiML/SmsTest.cs
+++ b/test/Twilio.Test/TwiML/SmsTest.cs
@@ -50,10 +50,11 @@ public void TestElementWithExtraAttributes()
var elem = new Sms();
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/SsmlBreakTest.cs b/test/Twilio.Test/TwiML/SsmlBreakTest.cs
index a3848b2d2..1b3836acb 100644
--- a/test/Twilio.Test/TwiML/SsmlBreakTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlBreakTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlBreak();
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/SsmlEmphasisTest.cs b/test/Twilio.Test/TwiML/SsmlEmphasisTest.cs
index 177c51d7e..66a6a6ea5 100644
--- a/test/Twilio.Test/TwiML/SsmlEmphasisTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlEmphasisTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlEmphasis();
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/SsmlLangTest.cs b/test/Twilio.Test/TwiML/SsmlLangTest.cs
index 30cfd54f5..41f7790cf 100644
--- a/test/Twilio.Test/TwiML/SsmlLangTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlLangTest.cs
@@ -43,10 +43,11 @@ public void TestElementWithExtraAttributes()
var elem = new SsmlLang();
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/SsmlPTest.cs b/test/Twilio.Test/TwiML/SsmlPTest.cs
index 81841d8b6..d204a21b0 100644
--- a/test/Twilio.Test/TwiML/SsmlPTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlPTest.cs
@@ -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()
);
}
diff --git a/test/Twilio.Test/TwiML/SsmlPhonemeTest.cs b/test/Twilio.Test/TwiML/SsmlPhonemeTest.cs
index f1db84c52..56ae26cd6 100644
--- a/test/Twilio.Test/TwiML/SsmlPhonemeTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlPhonemeTest.cs
@@ -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 324ddea7f..1be35b31c 100644
--- a/test/Twilio.Test/TwiML/SsmlProsodyTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlProsodyTest.cs
@@ -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()
);
}
diff --git a/test/Twilio.Test/TwiML/SsmlSTest.cs b/test/Twilio.Test/TwiML/SsmlSTest.cs
index fe22d57b5..93b3d07c4 100644
--- a/test/Twilio.Test/TwiML/SsmlSTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlSTest.cs
@@ -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()
);
}
diff --git a/test/Twilio.Test/TwiML/SsmlSayAsTest.cs b/test/Twilio.Test/TwiML/SsmlSayAsTest.cs
index c53c859ac..d9c2463e9 100644
--- a/test/Twilio.Test/TwiML/SsmlSayAsTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlSayAsTest.cs
@@ -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 59593bca1..92a2a93c9 100644
--- a/test/Twilio.Test/TwiML/SsmlSubTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlSubTest.cs
@@ -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 7b680bd44..17d638db1 100644
--- a/test/Twilio.Test/TwiML/SsmlWTest.cs
+++ b/test/Twilio.Test/TwiML/SsmlWTest.cs
@@ -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()
);
}
diff --git a/test/Twilio.Test/TwiML/StartTest.cs b/test/Twilio.Test/TwiML/StartTest.cs
index 3b5b1d79d..34fbfd023 100644
--- a/test/Twilio.Test/TwiML/StartTest.cs
+++ b/test/Twilio.Test/TwiML/StartTest.cs
@@ -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()
);
}
diff --git a/test/Twilio.Test/TwiML/StopTest.cs b/test/Twilio.Test/TwiML/StopTest.cs
index aab49dd8a..97259d47e 100644
--- a/test/Twilio.Test/TwiML/StopTest.cs
+++ b/test/Twilio.Test/TwiML/StopTest.cs
@@ -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()
);
}
diff --git a/test/Twilio.Test/TwiML/StreamTest.cs b/test/Twilio.Test/TwiML/StreamTest.cs
index 9add99695..81136c30f 100644
--- a/test/Twilio.Test/TwiML/StreamTest.cs
+++ b/test/Twilio.Test/TwiML/StreamTest.cs
@@ -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()
);
}
diff --git a/test/Twilio.Test/TwiML/TaskTest.cs b/test/Twilio.Test/TwiML/TaskTest.cs
index f9eaa5961..cce712d7e 100644
--- a/test/Twilio.Test/TwiML/TaskTest.cs
+++ b/test/Twilio.Test/TwiML/TaskTest.cs
@@ -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 5e4e4ee9e..7c7b8a19c 100644
--- a/test/Twilio.Test/TwiML/VirtualAgentTest.cs
+++ b/test/Twilio.Test/TwiML/VirtualAgentTest.cs
@@ -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()
);
}
diff --git a/test/Twilio.Test/TwiML/VoiceResponseTest.cs b/test/Twilio.Test/TwiML/VoiceResponseTest.cs
index 5f771e1ab..ca0f011e1 100644
--- a/test/Twilio.Test/TwiML/VoiceResponseTest.cs
+++ b/test/Twilio.Test/TwiML/VoiceResponseTest.cs
@@ -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()
);
}
@@ -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,
diff --git a/test/Twilio.Test/Twilio.Test.csproj b/test/Twilio.Test/Twilio.Test.csproj
index e023b9ed5..747f9706c 100644
--- a/test/Twilio.Test/Twilio.Test.csproj
+++ b/test/Twilio.Test/Twilio.Test.csproj
@@ -2,7 +2,7 @@
Exe
Twilio.Tests
- net6.0;net451;net35
+ net7.0;net451;net35
win7-x86
win7-x86
false