Ejemplo n.º 1
0
        public void Null_Converts_To_Detected_AppIcon()
        {
            var conv = new AppIconImageConverter();

            var result = conv.Convert(null, typeof(ImageSource), null, CultureInfo.CurrentCulture);

            Assert.AreSame(AppIconImageConverter.AppIcon, result);
        }
Ejemplo n.º 2
0
        public void ConvertBack_Converts_To_Unset()
        {
            var conv = new AppIconImageConverter();

            var result = conv.ConvertBack(null, typeof(bool), null, CultureInfo.CurrentCulture);

            Assert.AreEqual(DependencyProperty.UnsetValue, result, "No longer an unsupported operation?");
        }
Ejemplo n.º 3
0
        public void Not_Null_Converts_To_Input()
        {
            var conv = new AppIconImageConverter();
            // an 8x3 bw image
            var input = BitmapSource.Create(8, 3, 96, 96, PixelFormats.BlackWhite, BitmapPalettes.BlackAndWhite, new byte[] { 0, 255, 0 }, 1);

            var result = conv.Convert(input, typeof(ImageSource), "not", CultureInfo.CurrentCulture);

            Assert.AreSame(input, result);
        }