Exemple #1
0
        public void NetTimeToAlibabaTimeTest()
        {
            DateTime time   = new DateTime(2012, 8, 1, 15, 42, 20, 368, DateTimeKind.Local);
            string   actual = AlibabaHelper.NetTimeToAlibabaTime(time);

            Assert.AreEqual <string>("20120801154220368+0800", actual);
        }
Exemple #2
0
        public void GetArgumentsDictionaryTest()
        {
            DateTime now  = DateTime.Now;
            object   args = new {
                a = 13,
                b = true,
                c = "xphter",
                d = now,
                e = new int[] {
                    123, 456,
                },
                f = new string[] {
                    "123", "456",
                },
            };
            IDictionary <string, string> actual = AlibabaHelper.GetArgumentsDictionary(args);

            Assert.AreEqual(actual["a"], "13");
            Assert.AreEqual(actual["b"], "true");
            Assert.AreEqual(actual["c"], "xphter");
            Assert.AreEqual(actual["d"], AlibabaHelper.NetTimeToAlibabaTime(now));
            Assert.AreEqual(actual["e"], "[123,456]");
            Assert.AreEqual(actual["f"], "[\"123\",\"456\"]");
        }