Exemplo n.º 1
0
        public void ToTypedRow_MyComplexDataWithArray()
        {
            var row1 = new MyComplexDataWithArray
            {
                ID   = 12345,
                Data = new MySimpleData[] {
                    new MySimpleData
                    {
                        Name         = "Graf Orlov",
                        DOB          = new DateTime(1980, 12, 11, 19, 23, 11),
                        Certified    = true,
                        ServiceYears = 37,
                        Salary       = 123455.8712m
                    },
                    new MySimpleData
                    {
                        Name         = "Oleg Popov",
                        DOB          = new DateTime(1981, 11, 01, 14, 08, 19),
                        Certified    = true,
                        ServiceYears = 37,
                        Salary       = 123455.8712m
                    }
                }
            };

            var str = row1.ToJSON(JSONWritingOptions.PrettyPrintRowsAsMap);

            Console.WriteLine(str);

            MyComplexDataWithArray row2 = str.JSONToDynamic();

            Assert.IsTrue(row1.Equals(row2));
        }
Exemplo n.º 2
0
        public void ToTypedRow_MyComplexDataWithArray()
        {
            var row1 = new MyComplexDataWithArray
            {
                ID   = 12345,
                Data = new MySimpleData[] {
                    new MySimpleData
                    {
                        Name         = "Graf Orlov",
                        DOB          = new DateTime(1980, 12, 11, 19, 23, 11, DateTimeKind.Utc),
                        Certified    = true,
                        ServiceYears = 37,
                        Salary       = 123455.8712m
                    },
                    new MySimpleData
                    {
                        Name         = "Oleg Popov",
                        DOB          = new DateTime(1981, 11, 01, 14, 08, 19, DateTimeKind.Utc),
                        Certified    = true,
                        ServiceYears = 37,
                        Salary       = 123455.8712m
                    }
                }
            };

            var str = row1.ToJson(JsonWritingOptions.PrettyPrintRowsAsMap);

            str.See();

            MyComplexDataWithArray row2 = str.JsonToDynamic();

            Aver.IsTrue(row1.Equals(row2));
        }
Exemplo n.º 3
0
        public void ToTypedRow_MyComplexDataWithArray()
        {
            var row1 = new MyComplexDataWithArray
            { ID = 12345,
              Data = new MySimpleData[]{
                new MySimpleData
                {
                  Name = "Graf Orlov",
                  DOB = new DateTime(1980,12,11,19,23,11),
                  Certified = true,
                  ServiceYears = 37,
                  Salary = 123455.8712m
                },
                new MySimpleData
                {
                  Name = "Oleg Popov",
                  DOB = new DateTime(1981,11,01,14,08,19),
                  Certified = true,
                  ServiceYears = 37,
                  Salary = 123455.8712m
                }
              }
            };

            var str = row1.ToJSON(JSONWritingOptions.PrettyPrintRowsAsMap);

            Console.WriteLine(str);

            MyComplexDataWithArray row2 = str.JSONToDynamic();

            Assert.IsTrue(row1.Equals(row2));
        }