Beispiel #1
0
        public void BlackAndWhiteBackgroundsResultsInWhiteAndBlackForeground()
        {
            // Arrange
            var conv = new ForegroundColor();

            // Act
            object white = conv.Convert("000000", null, null, null);
            object black = conv.Convert("ffffff", null, null, null);

            // Assert
            SolidColorBrush brush = white as SolidColorBrush;

            Assert.IsNotNull(brush);
            Assert.AreEqual(Colors.White, brush.Color);

            brush = black as SolidColorBrush;
            Assert.IsNotNull(brush);
            Assert.AreEqual(Colors.Black, brush.Color);
        }
Beispiel #2
0
        public void ConvertInvalidValueResultsInUnset()
        {
            // Arrange
            var conv = new ForegroundColor();

            // Act
            object converted = conv.Convert(123, null, null, null);

            // Assert
            Assert.AreEqual(DependencyProperty.UnsetValue, converted);
        }
Beispiel #3
0
        public void RedBackgroundResultsInWhiteColor()
        {
            // Arrange
            var conv = new ForegroundColor();

            // Act
            object color = conv.Convert("ff0000", null, null, null);

            // Assert
            SolidColorBrush brush = color as SolidColorBrush;

            Assert.IsNotNull(brush);
            Assert.AreEqual(Colors.White, brush.Color);
        }
Beispiel #4
0
        public void LightGrayResultsInBlack()
        {
            // Arrange
            var conv = new ForegroundColor();

            // Act
            object color = conv.Convert("cccccc", null, null, null);

            // Assert
            SolidColorBrush brush = color as SolidColorBrush;

            Assert.IsNotNull(brush);
            Assert.AreEqual(Colors.Black, brush.Color);
        }