<commit_before>using Uno;
using Uno.Collections;
using Uno.Testing;
using Fuse;
using FuseTest;

namespace Fuse.ImageTools.Test
{
	public class ImageToolsTest : TestBase
	{
		private Object _image = null;

		[Test]
		[Ignore("Only supported on dotnet", "!DOTNET")]
		public void CreatingAnImageSucceeds()
		{
			Fuse.ImageTools.ImageTools image = new Fuse.ImageTools.ImageTools();
			using (var root = new TestRootPanel()){
				var future = ImageTools.ImageFromBase64("iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPAQMAAAABGAcJAAAABlBMVEX9//wAAQATpOzaAAAAH0l" + "EQVQI12MAAoMHIFLAAYSEwIiJgYGZASrI38AAAwBamgM5VF7xgwAAAABJRU5ErkJggg==");
				future.Then(Print, Fail);
				Assert.IsFalse(_image == null);
			}
			_image = null;
		}

		void MakeInvalidImage()
		{
			Fuse.ImageTools.ImageTools image = new Fuse.ImageTools.ImageTools();
			var future = ImageTools.ImageFromBase64("iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPAQMAAAABGAcJAAAABlBMVEX9//wAAQATpOzaAAAAH0l");
			future.Then(Print, Fail);
		}

		[Test]
		[Ignore("Only supported on dotnet", "!DOTNET")]
		public void CreatingAnImageFails()
		{
			Assert.Throws<FormatException>(MakeInvalidImage);
		}

		private void Fail(Exception e)
		{
			_image = null;
		}

		private void Print(Object image)
		{<commit_msg>amend ignore platform and rename some functions<commit_after>using Uno;
using Uno.Collections;
using Uno.Testing;
using Fuse;
using FuseTest;

namespace Fuse.ImageTools.Test
{
	public class ImageToolsTest : TestBase
	{
		private Object _image = null;

		[Test]
		[Ignore("Only supported on dotnet, Android or iOS", "native")]
		public void CreatingAnImageSucceeds()
		{
			using (var root = new TestRootPanel()){
				var future = ImageTools.ImageFromBase64("iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPAQMAAAABGAcJAAAABlBMVEX9//wAAQATpOzaAAAAH0l" + "EQVQI12MAAoMHIFLAAYSEwIiJgYGZASrI38AAAwBamgM5VF7xgwAAAABJRU5ErkJggg==");
				future.Then(SaveImage, Fail);
				Assert.IsFalse(_image == null);
			}
			_image = null;
		}

		void MakeInvalidImage()
		{
			var future = ImageTools.ImageFromBase64("iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPAQMAAAABGAcJAAAABlBMVEX9//wAAQATpOzaAAAAH0l");
			future.Then(SaveImage, Fail);
		}

		[Test]
		[Ignore("Only supported on dotnet, Android or iOS", "native")]
		public void CreatingAnImageFails()
		{
			Assert.Throws<FormatException>(MakeInvalidImage);
		}

		private void Fail(Exception e)
		{
			_image = null;
		}

		private void SaveImage(Object image)
		{
{'fraction_non_alphanumeric': 0.10256410256410256, 'fraction_numerical': 0.015715467328370553, 'mean_word_length': 4.972839506172839, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3010689', 'n_tokens_mistral': 1056, 'n_tokens_neox': 916, 'n_words': 162}