Beispiel #1
0
        public void ToFromRowWithBinaryData()
        {
            var r1 = new RowWithBinaryData
            {
                FileName    = "SaloInstructions.txt",
                ContentType = "text/plain",
                Content     = new byte[] { 1, 2, 3, 120 }
            };

            var json = r1.ToJSON(JSONWritingOptions.PrettyPrintRowsAsMap);

            Console.WriteLine(json);

            RowWithBinaryData r2 = json.JSONToDynamic();

            Assert.AreEqual(r1.FileName, r2.FileName);
            Assert.AreEqual(r1.ContentType, r2.ContentType);
            Assert.IsTrue(r1.Content.SequenceEqual(r2.Content));
        }
Beispiel #2
0
        public void ToFromRowWithBinaryData()
        {
            var r1 = new RowWithBinaryData
            {
                FileName    = "SaloInstructions.txt",
                ContentType = "text/plain",
                Content     = new byte[] { 1, 2, 3, 120 }
            };

            var json = r1.ToJson(JsonWritingOptions.PrettyPrintRowsAsMap);

            json.See();

            RowWithBinaryData r2 = json.JsonToDynamic();

            Aver.AreEqual(r1.FileName, r2.FileName);
            Aver.AreEqual(r1.ContentType, r2.ContentType);
            Aver.IsTrue(r1.Content.SequenceEqual(r2.Content));
        }
Beispiel #3
0
        public void ToFromRowWithBinaryData()
        {
            var r1 = new RowWithBinaryData
            {
              FileName = "SaloInstructions.txt",
              ContentType = "text/plain",
              Content = new byte[]{1,2,3,120}
            };

            var json =  r1.ToJSON(JSONWritingOptions.PrettyPrintRowsAsMap);

            Console.WriteLine(json);

            RowWithBinaryData r2 = json.JSONToDynamic();

            Assert.AreEqual(r1.FileName, r2.FileName);
            Assert.AreEqual(r1.ContentType, r2.ContentType);
            Assert.IsTrue( r1.Content.SequenceEqual(r2.Content) );
        }