System\Windows\Forms\ComponentModel\Com2Interop\COM2PictureConverterTests.cs (15)
27Assert.Null(Instance.ConvertNativeToManaged(default, null));
69Assert.Null(Instance.ConvertNativeToManaged((VARIANT)unknown.Value, null));
80using Icon icon = (Icon)Instance.ConvertNativeToManaged((VARIANT)unknown.Value, null);
84Assert.Equal(typeof(Icon), Instance.ManagedType);
87Assert.Same(icon, (Icon)Instance.ConvertNativeToManaged((VARIANT)unknown.Value, null));
100using Bitmap bitmap = (Bitmap)Instance.ConvertNativeToManaged((VARIANT)unknown.Value, property: null);
104Assert.Equal(typeof(Bitmap), Instance.ManagedType);
107Assert.Same(bitmap, (Bitmap)Instance.ConvertNativeToManaged((VARIANT)unknown.Value, property: null));
122Assert.Null(Instance.ConvertNativeToManaged((VARIANT)unknown.Value, null));
130Assert.True(Instance.ConvertManagedToNative(null, null, ref cancelSet).IsEmpty);
140using VARIANT native = Instance.ConvertManagedToNative(exclamationIcon, null, ref cancelSet);
152Assert.Same(exclamationIcon, Instance.ConvertNativeToManaged((VARIANT)picture.AsUnknown, null));
161using VARIANT native = Instance.ConvertManagedToNative(bitmap, null, ref cancelSet);
173Assert.Same(bitmap, Instance.ConvertNativeToManaged((VARIANT)picture.AsUnknown, null));
184Assert.True(Instance.ConvertManagedToNative(new object(), null, ref cancelSet).IsEmpty);