Beispiel #1
0
 private void CategoryCellVew_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName != nameof(IsSelected))
     {
         return;
     }
     SeparatorStack.Opacity = Opacity = (double)_converter.Convert(IsSelected, Opacity.GetType(), null, null);
     SelectImage.IsVisible  = IsSelected;
     FireItemSelection();
 }
        public void Convert_NullReferenceException_parameter()
        {
            // Arrange
            var converter = new BoolToOpacityConverter();

            // Act
            converter.Convert(false, null, null, null);
        }
        public void Convert_FormatException_parameter()
        {
            // Arrange
            var converter = new BoolToOpacityConverter();

            // Act
            converter.Convert(false, null, "foo", null);
        }
        public void Convert_InvalidCastException_value()
        {
            // Arrange
            var converter = new BoolToOpacityConverter();

            // Act
            converter.Convert(2.0, null, null, null);
        }
        public void Convert_TrueToLowerOpacity()
        {
            // Arrange
            var converter = new BoolToOpacityConverter();

            // Act
            var result = converter.Convert(false, null, "0.5", null);

            // Assert
            Assert.AreEqual(0.5, result);
        }
        public void Convert_TrueToFullOpacity()
        {
            // Arrange
            var converter = new BoolToOpacityConverter();

            // Act
            var result = converter.Convert(true, null, null, null);

            // Assert
            Assert.AreEqual(1.0, result);
        }