Exemple #1
0
        public void TestByteArrayPropertyToXml()
        {
            var serializable = new WithByteArrayProperty()
            {
                AnyByteArray = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
            };

            var xml = serializable.ToXml();

            var doc     = XDocument.Parse(xml);
            var element = doc.XPathSelectElement("/Bytes/AnyBase64String");

            Assert.AreEqual("AQIDBAUGBwgJ", element.Value);
        }
        public void TestByteArrayPropertyToXml()
        {
            var serializable = new WithByteArrayProperty()
            {
                AnyByteArray = null
            };

            var xml = serializable.ToXml();

            var doc     = XDocument.Parse(xml);
            var element = doc.XPathSelectElement("/Bytes/AnyBase64String");

            Assert.AreEqual("", element.Value);
        }