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 | e883d4c9d9f513b10e554718cf46f5b447960c94 (patch) | |
tree | 141236370fd63d4050b1b7e2741bbe87f1ad3b41 /SendGrid/Tests/TestUtils.cs | |
parent | 3bffb9c83a6983e83cfd842e3f6814a568fa0dc9 (diff) | |
parent | 1c547b68a1493a6a859716aa74e14980d526c152 (diff) | |
download | sendgrid-csharp-e883d4c9d9f513b10e554718cf46f5b447960c94.zip sendgrid-csharp-e883d4c9d9f513b10e554718cf46f5b447960c94.tar.gz sendgrid-csharp-e883d4c9d9f513b10e554718cf46f5b447960c94.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);
+ }
+ }
+}
|