diff options
Diffstat (limited to 'SendGrid/Tests/TestJsonUtils.cs')
-rwxr-xr-x | SendGrid/Tests/TestJsonUtils.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/SendGrid/Tests/TestJsonUtils.cs b/SendGrid/Tests/TestJsonUtils.cs new file mode 100755 index 0000000..b06e153 --- /dev/null +++ b/SendGrid/Tests/TestJsonUtils.cs @@ -0,0 +1,22 @@ +using System.Text;
+using NUnit.Framework;
+using SendGridMail;
+
+namespace Tests
+{
+ [TestFixture]
+ public class TestJsonUtils
+ {
+ [Test]
+ public void TestSerialize()
+ {
+ Assert.AreEqual("1", JsonUtils.Serialize(1));
+ Assert.AreEqual("\"\\\"foo\\\"\"", JsonUtils.Serialize("\"foo\""));
+
+ var arg = Encoding.UTF8.GetString(Encoding.ASCII.GetBytes("добры дзень"));
+ var result = JsonUtils.Serialize(arg);
+ System.Console.WriteLine(arg + " => " + result);
+ Assert.AreEqual("", result);
+ }
+ }
+}
|