Exemplo n.º 1
0
        public void ConvertBackThrowsException()
        {
            // Arrange
            var conv = new ColorToBrush();

            // Act

            // Assert
            ExceptionAssert.Throws <NotSupportedException>(() => conv.ConvertBack(null, null, null, null));
        }
Exemplo n.º 2
0
        public void Converter_ColorToBrushTests()
        {
            ColorToBrush conv      = new ColorToBrush();
            var          convBrush = conv.Convert(Colors.White, typeof(Brush), null, CultureInfo.CurrentCulture);
            var          brush     = new SolidColorBrush(Colors.White);

            Assert.AreEqual(brush.Color, ((SolidColorBrush)convBrush).Color,
                            "ColorToBrush Convert did not return the correct brush");
            var clr = conv.ConvertBack(new SolidColorBrush(Colors.White), typeof(Color), null, CultureInfo.CurrentCulture);

            Assert.AreEqual(Colors.White, clr,
                            "ColorToBrush ConvertBack did not return the correct color");
        }