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

            // Act

            // Assert
            ExceptionAssert.Throws<NotSupportedException>( () => conv.ConvertBack( null, null, null, null ) );
        }
Beispiel #2
0
        public void ConvertInvalidTypeReturnsUnset()
        {
            // Arrange
            var conv = new ColorToBrush();

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

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

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

            // Assert
            SolidColorBrush brush = converted as SolidColorBrush;
            Assert.IsNotNull( brush );
            Assert.AreEqual( Colors.Yellow, brush.Color );
        }