예제 #1
0
        public void ToAmorphousTypedRow_FromOtherRow()
        {
            var row1 = new MySimpleAmorphousData
            {
                Name         = "Graf Orlov",
                DOB          = new DateTime(1980, 12, 11, 19, 23, 11),
                Certified    = true,
                ServiceYears = 37,
                Salary       = 123455.8712m
            };

            row1.AmorphousData["frage"]   = "Was machst du mit dem schwert?";
            row1.AmorphousData["antwort"] = "Ich kämpfe damit";

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

            Console.WriteLine(str);

            MySimpleAmorphousData row2 = str.JSONToDynamic();

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

            Assert.AreEqual("Was machst du mit dem schwert?", row2.AmorphousData["frage"]);
            Assert.AreEqual("Ich kämpfe damit", row2.AmorphousData["antwort"]);
        }
예제 #2
0
        public void ToAmorphousTypedRow_FromOtherRow()
        {
            var row1 = new MySimpleAmorphousData
            {
                Name         = "Graf Orlov",
                DOB          = new DateTime(1980, 12, 11, 19, 23, 11, DateTimeKind.Utc),
                Certified    = true,
                ServiceYears = 37,
                Salary       = 123455.8712m
            };

            row1.AmorphousData["frage"]   = "Was machst du mit dem schwert?";
            row1.AmorphousData["antwort"] = "Ich kämpfe damit";

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

            str.See();

            MySimpleAmorphousData row2 = str.JsonToDynamic();

            Aver.IsTrue(row1.Equals(row2));

            Aver.AreObjectsEqual("Was machst du mit dem schwert?", row2.AmorphousData["frage"]);
            Aver.AreObjectsEqual("Ich kämpfe damit", row2.AmorphousData["antwort"]);
        }
예제 #3
0
        public void ToAmorphousTypedRow_FromOtherRow()
        {
            var row1 = new MySimpleAmorphousData
            {
              Name = "Graf Orlov",
              DOB = new DateTime(1980,12,11,19,23,11),
              Certified = true,
              ServiceYears = 37,
              Salary = 123455.8712m
            };
            row1.AmorphousData["frage"] = "Was machst du mit dem schwert?";
            row1.AmorphousData["antwort"] = "Ich kämpfe damit";

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

            Console.WriteLine(str);

            MySimpleAmorphousData row2 = str.JSONToDynamic();

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

            Assert.AreEqual("Was machst du mit dem schwert?", row2.AmorphousData["frage"]);
            Assert.AreEqual("Ich kämpfe damit", row2.AmorphousData["antwort"]);
        }