Exemplo n.º 1
0
        public void ConvertToString()
        {
            Assert.AreEqual(("X", false), ETagGenerator.ConvertToString("X"));
            Assert.AreEqual(("1", false), ETagGenerator.ConvertToString(1));
            Assert.AreEqual(("1.51", false), ETagGenerator.ConvertToString(1.51m));
            Assert.AreEqual(("1990-01-31T08:09:10.0000000", false), ETagGenerator.ConvertToString(new DateTime(1990, 01, 31, 08, 09, 10)));

            var g = Guid.NewGuid();

            Assert.AreEqual((g.ToString(), false), ETagGenerator.ConvertToString(g));

            var p = new Person {
                First = "Jane", Last = "Doe"
            };

            Assert.AreEqual(("{\"First\":\"Jane\",\"Last\":\"Doe\"}", true), ETagGenerator.ConvertToString(p));
        }