Example #1
0
        public void ToTypedRow_MyComplexDataWithList()
        {
            var row1 = new MyComplexDataWithList
            {
                ID   = 12345,
                Data = new List <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);

            MyComplexDataWithList row2 = str.JSONToDynamic();

            Assert.IsTrue(row1.Equals(row2));
        }
Example #2
0
        public void ToTypedRow_MyComplexDataWithList()
        {
            var row1 = new MyComplexDataWithList
            {
                ID   = 12345,
                Data = new List <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();

            MyComplexDataWithList row2 = str.JsonToDynamic();

            Aver.IsTrue(row1.Equals(row2));
        }
Example #3
0
        public void ToTypedRow_MyComplexDataWithList()
        {
            var row1 = new MyComplexDataWithList
            { ID = 12345,
              Data = new List<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);

            MyComplexDataWithList row2 = str.JSONToDynamic();

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