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

            // Act

            // Assert
            ExceptionAssert.Throws<NotSupportedException>( () => conv.ConvertBack( null, null, null, null ) );
        }
Ejemplo n.º 2
0
        public void ConvertMultipliesCorrectValues()
        {
            // Arrange
            var conv = new RelativeWidth();

            // Act
            object converted = conv.Convert( 100.0, null, "80", null );

            // Assert
            Assert.AreEqual( 80.0, converted );
        }
Ejemplo n.º 3
0
        public void ConvertWithInvalidParameterReturnsUnset()
        {
            // Arrange
            var conv = new RelativeWidth();

            // Act
            object empty = conv.Convert( 1.3, null, null, null );
            object invalid = conv.Convert( 1.3, null, string.Empty, null );

            // Assert
            Assert.AreEqual( DependencyProperty.UnsetValue, empty );
            Assert.AreEqual( DependencyProperty.UnsetValue, invalid );
        }