summaryrefslogtreecommitdiffstats
path: root/SendGrid/Tests/TestJsonUtils.cs
blob: b06e1533c705ff25a2eaaf92eaa20cbf5a917b73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
        }
    }
}