Beispiel #1
0
        static void Main()
        {
            MyTest myTest = new MyTest();

            myTest.ID     = 1;
            myTest.dtDate = DateTime.Now;
            myTest.Remark = "Json数据解析,回车换行符支持测试\r\n";

            string path = @"C:\\Users\\Werish\\Desktop\\Project Key.txt";

            myTest.bPhoto = File.ReadAllBytes(path);

            string jsonData = Converter.Serialize(myTest);
        }
Beispiel #2
0
        public void DeserializeTest()
        {
            try
            {
                MyTest myTest = new MyTest();

                myTest.ID     = 1;
                myTest.dtDate = DateTime.Now;
                myTest.Remark = "Json数据解析,回车换行符支持测试\r\n";

                string path = @"C:\\Users\\Werish\\Desktop\\Project Key.txt";

                myTest.bPhoto = File.ReadAllBytes(path);

                string jsonData = Converter.Serialize(myTest);

                MessageBoxEx.Show(jsonData);
            }
            catch (Exception ex)
            {
                Assert.Inconclusive("Verify the correctness of this test method." + ex.Message);
            }
        }