1 write to _imgConv
System.Drawing.Common.Tests (1)
System\Drawing\ImageConverterTests.cs (1)
28_imgConv = new ImageConverter();
53 references to _imgConv
System.Drawing.Common.Tests (53)
System\Drawing\ImageConverterTests.cs (53)
39Bitmap IconBitmap = (Bitmap)_imgConv.ConvertFrom(icon); 61Assert.True(_imgConv.CanConvertFrom(typeof(byte[])), "byte[] (no context)"); 62Assert.True(_imgConv.CanConvertFrom(null, typeof(byte[])), "byte[]"); 63Assert.True(_imgConv.CanConvertFrom(null, _imageBytes.GetType()), "_imageBytes.GetType()"); 64Assert.True(_imgConv.CanConvertFrom(typeof(Icon)), "Icon (no context)"); 65Assert.True(_imgConv.CanConvertFrom(null, typeof(Icon)), "Icon"); 66Assert.False(_imgConv.CanConvertFrom(null, typeof(string)), "string"); 67Assert.False(_imgConv.CanConvertFrom(null, typeof(Rectangle)), "Rectangle"); 68Assert.False(_imgConv.CanConvertFrom(null, typeof(Point)), "Point"); 69Assert.False(_imgConv.CanConvertFrom(null, typeof(PointF)), "PointF"); 70Assert.False(_imgConv.CanConvertFrom(null, typeof(Size)), "Size"); 71Assert.False(_imgConv.CanConvertFrom(null, typeof(SizeF)), "SizeF"); 72Assert.False(_imgConv.CanConvertFrom(null, typeof(object)), "object"); 73Assert.False(_imgConv.CanConvertFrom(null, typeof(int)), "int"); 74Assert.False(_imgConv.CanConvertFrom(null, typeof(Metafile)), "Mefafile"); 93Assert.True(_imgConv.CanConvertTo(typeof(string)), "stirng (no context)"); 94Assert.True(_imgConv.CanConvertTo(null, typeof(string)), "string"); 95Assert.True(_imgConv.CanConvertTo(null, _imageStr.GetType()), "_imageStr.GetType()"); 96Assert.True(_imgConv.CanConvertTo(typeof(byte[])), "byte[] (no context)"); 97Assert.True(_imgConv.CanConvertTo(null, typeof(byte[])), "byte[]"); 98Assert.True(_imgConv.CanConvertTo(null, _imageBytes.GetType()), "_imageBytes.GetType()"); 99Assert.False(_imgConv.CanConvertTo(null, typeof(Rectangle)), "Rectangle"); 100Assert.False(_imgConv.CanConvertTo(null, typeof(Point)), "Point"); 101Assert.False(_imgConv.CanConvertTo(null, typeof(PointF)), "PointF"); 102Assert.False(_imgConv.CanConvertTo(null, typeof(Size)), "Size"); 103Assert.False(_imgConv.CanConvertTo(null, typeof(SizeF)), "SizeF"); 104Assert.False(_imgConv.CanConvertTo(null, typeof(object)), "object"); 105Assert.False(_imgConv.CanConvertTo(null, typeof(int)), "int"); 125Image newImage = (Image)_imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, _imageBytes); 139Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom("System.Drawing.String")); 140Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String")); 141Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, new Bitmap(20, 20))); 142Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, new Point(10, 10))); 143Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10))); 144Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, new object())); 157Assert.Equal(_imageStr, (string)_imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(string))); 158Assert.Equal(_imageStr, (string)_imgConv.ConvertTo(_image, typeof(string))); 164Assert.Equal("(none)", (string)_imgConv.ConvertTo(null, typeof(string))); 165Assert.Equal("(none)", (string)_imgConv.ConvertTo(null, CultureInfo.CreateSpecificCulture("ru-RU"), null, typeof(string))); 175byte[] newImageBytes = (byte[])_imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, _imageBytes.GetType()); 197Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Rectangle))); 198Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, _image.GetType())); 199Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Size))); 200Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Bitmap))); 201Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Point))); 202Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Metafile))); 203Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(object))); 204Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(int))); 219Assert.True(_imgConv.GetPropertiesSupported(), "GetPropertiesSupported()"); 220Assert.True(_imgConv.GetPropertiesSupported(null), "GetPropertiesSupported(null)"); 232propsColl = _imgConv.GetProperties(null, _image, null); 236propsColl = _imgConv.GetProperties(null, _image); 238propsColl = _imgConv.GetProperties(_image);