1 write to _imgFmtConvFrmTD
System.Drawing.Common.Tests (1)
System\Drawing\ImageFormatConverterTests.cs (1)
23
_imgFmtConvFrmTD
= (ImageFormatConverter)TypeDescriptor.GetConverter(_imageFmt);
29 references to _imgFmtConvFrmTD
System.Drawing.Common.Tests (29)
System\Drawing\ImageFormatConverterTests.cs (29)
36
Assert.True(
_imgFmtConvFrmTD
.CanConvertFrom(typeof(string)), "TD string (no context)");
37
Assert.True(
_imgFmtConvFrmTD
.CanConvertFrom(null, typeof(string)), "TD string");
38
Assert.False(
_imgFmtConvFrmTD
.CanConvertFrom(null, typeof(ImageFormat)), "TD ImageFormat");
39
Assert.False(
_imgFmtConvFrmTD
.CanConvertFrom(null, typeof(Guid)), "TD Guid");
40
Assert.False(
_imgFmtConvFrmTD
.CanConvertFrom(null, typeof(object)), "TD object");
41
Assert.False(
_imgFmtConvFrmTD
.CanConvertFrom(null, typeof(int)), "TD int");
54
Assert.True(
_imgFmtConvFrmTD
.CanConvertTo(typeof(string)), "TD string (no context)");
55
Assert.True(
_imgFmtConvFrmTD
.CanConvertTo(null, typeof(string)), "TD string");
56
Assert.False(
_imgFmtConvFrmTD
.CanConvertTo(null, typeof(ImageFormat)), "TD ImageFormat");
57
Assert.False(
_imgFmtConvFrmTD
.CanConvertTo(null, typeof(Guid)), "TD Guid");
58
Assert.False(
_imgFmtConvFrmTD
.CanConvertTo(null, typeof(object)), "TD object");
59
Assert.False(
_imgFmtConvFrmTD
.CanConvertTo(null, typeof(int)), "TD int");
66
Assert.Equal(_imageFmt, (ImageFormat)
_imgFmtConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp.ToString()));
77
Assert.Throws<NotSupportedException>(() =>
_imgFmtConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp));
78
Assert.Throws<NotSupportedException>(() =>
_imgFmtConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp.Guid));
79
Assert.Throws<NotSupportedException>(() =>
_imgFmtConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
80
Assert.Throws<NotSupportedException>(() =>
_imgFmtConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, 10));
85
return (ImageFormat)
_imgFmtConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, imgFormatName);
122
Assert.Throws<FormatException>(() =>
_imgFmtConvFrmTD
.ConvertFrom("System.Drawing.String"));
123
Assert.Throws<FormatException>(() =>
_imgFmtConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
124
Assert.Throws<FormatException>(() =>
_imgFmtConvFrmTD
.ConvertFrom("[ImageFormat: abcdefgh-ijkl-mnop-qrst-uvwxyz012345]"));
133
Assert.Equal(_imageFmtStr, (string)
_imgFmtConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(string)));
134
Assert.Equal(_imageFmtStr, (string)
_imgFmtConvFrmTD
.ConvertTo(_imageFmt, typeof(string)));
139
Assert.Equal(string.Empty, (string)
_imgFmtConvFrmTD
.ConvertTo(null, typeof(string)));
140
Assert.Equal(string.Empty, (string)
_imgFmtConvFrmTD
.ConvertTo(null, CultureInfo.CreateSpecificCulture("de-DE"), null, typeof(string)));
151
Assert.Throws<NotSupportedException>(() =>
_imgFmtConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(ImageFormat)));
152
Assert.Throws<NotSupportedException>(() =>
_imgFmtConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(Guid)));
153
Assert.Throws<NotSupportedException>(() =>
_imgFmtConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(object)));
154
Assert.Throws<NotSupportedException>(() =>
_imgFmtConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(int)));