summaryrefslogtreecommitdiffstats
path: root/SendGrid/Tests/TestJsonUtils.cs
diff options
context:
space:
mode:
authorTyler Bischel <tyler.bischel@sendgrid.com>2012-01-10 17:33:13 -0800
committerTyler Bischel <tyler.bischel@sendgrid.com>2012-01-10 17:33:13 -0800
commitb13f35419a29ace0ecaabff02552a0613aa8afe2 (patch)
tree83dba1149b6f90d53935186ee0a601d851a50647 /SendGrid/Tests/TestJsonUtils.cs
parent7251a831e634eda2f98885777468b9f5aad6cd00 (diff)
downloadsendgrid-csharp-b13f35419a29ace0ecaabff02552a0613aa8afe2.zip
sendgrid-csharp-b13f35419a29ace0ecaabff02552a0613aa8afe2.tar.gz
sendgrid-csharp-b13f35419a29ace0ecaabff02552a0613aa8afe2.tar.bz2
example project sends email, tree node for filters created, json encoding done, other fixes
Diffstat (limited to 'SendGrid/Tests/TestJsonUtils.cs')
-rwxr-xr-xSendGrid/Tests/TestJsonUtils.cs22
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);
+ }
+ }
+}