diff options
author | Tyler Bischel <tyler.bischel@sendgrid.com> | 2012-01-16 23:44:30 -0800 |
---|---|---|
committer | Tyler Bischel <tyler.bischel@sendgrid.com> | 2012-01-16 23:44:30 -0800 |
commit | 85265f48de06629ff7307d642ce765e7b34843a1 (patch) | |
tree | d9dcc93abe5dd4521a48917e26e0f71ca611b756 /SendGrid/Tests/TestUtils.cs | |
parent | cc7e8b7a0aae5381899ea1ea4c91e467f170348a (diff) | |
parent | 2cfea4a2829103b413175deac64d62caea141b5c (diff) | |
download | sendgrid-csharp-85265f48de06629ff7307d642ce765e7b34843a1.zip sendgrid-csharp-85265f48de06629ff7307d642ce765e7b34843a1.tar.gz sendgrid-csharp-85265f48de06629ff7307d642ce765e7b34843a1.tar.bz2 |
Merge branch 'us1882' of github.com:sendgrid/sendgrid-csharp
Diffstat (limited to 'SendGrid/Tests/TestUtils.cs')
-rwxr-xr-x | SendGrid/Tests/TestUtils.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/SendGrid/Tests/TestUtils.cs b/SendGrid/Tests/TestUtils.cs new file mode 100755 index 0000000..48febcf --- /dev/null +++ b/SendGrid/Tests/TestUtils.cs @@ -0,0 +1,38 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+using SendGridMail;
+
+namespace Tests
+{
+ [TestFixture]
+ public class TestUtils
+ {
+ [Test]
+ public void TestSerialize()
+ {
+ var testcase = "foo";
+ String result = Utils.Serialize(testcase);
+ Assert.AreEqual("\"foo\"", result);
+
+ var testcase2 = 1;
+ result = Utils.Serialize(testcase2);
+ Assert.AreEqual("1", result);
+ }
+
+ [Test]
+ public void TestSerializeDictionary()
+ {
+ var test = new Dictionary<string, string>
+ {
+ {"a", "b"},
+ {"c", "d/e"}
+ };
+ var result = Utils.SerializeDictionary(test);
+ var expected = "{\"a\":\"b\",\"c\":\"d\\/e\"}";
+ Assert.AreEqual(expected, result);
+ }
+ }
+}
|