Ejemplo n.º 1
0
        public void Can_parse_svg_datauri()
        {
            var dataUri = Svg.GetDataUri(Svg.Icons.Male);
            var content = StaticContent.CreateFromDataUri(dataUri);

            Assert.That(content.MimeType, Is.EqualTo("image/svg+xml"));
            Assert.That(content.Data.FromUtf8().ToString(), Is.EqualTo(Svg.GetImage(Svg.Icons.Male)));
        }
Ejemplo n.º 2
0
        public void Can_parse_base_datauri()
        {
            var utf8Bytes = "abc".ToUtf8Bytes();
            var dataUri   = "data:image/jpg;base64," + Convert.ToBase64String(utf8Bytes);
            var content   = StaticContent.CreateFromDataUri(dataUri);

            Assert.That(content.MimeType, Is.EqualTo("image/jpg"));
            Assert.That(content.Data.ToArray(), Is.EqualTo(utf8Bytes));
        }