public void TestFromStreamMimeType() { // arbitrary bytes byte[] contents = { 0, 1, 2, 3, 4 }; var stream = new MemoryStream(contents); var resource = CesiumResource.FromStream(stream, "application/octet-stream"); Assert.IsNotNull(resource); const string expected = "data:application/octet-stream;base64,AAECAwQ="; Assert.AreEqual(expected, resource.Uri); }
public void TestFromStream() { // arbitrary bytes byte[] contents = { 0, 1, 2, 3, 4 }; var stream = new MemoryStream(contents); var resource = CesiumResource.FromStream(stream, CesiumImageFormat.Png); Assert.IsNotNull(resource); const string expected = "data:image/png;base64,AAECAwQ="; Assert.AreEqual(expected, resource.Uri); }